How to remove linux-image-5.11.0-41-generic
manually in ubuntu 20.04?
I am getting errors like this when I try to update, install, remove package.
(Reading database ... 211704 files and directories currently installed.)
Removing linux-image-5.11.0-41-generic (5.11.0-41.45~20.04.1) ...
/etc/kernel/postrm.d/initramfs-tools:
update-initramfs: Deleting /boot/initrd.img-5.11.0-41-generic
/etc/kernel/postrm.d/zz-update-grub:
Sourcing file `/etc/default/grub.d/init-select.cfg'
Generating grub configuration file ...
Script `/boot/grub/grub.cfg.new' contains no commands and will do nothing
Syntax errors are detected in generated GRUB config file.
Ensure that there are no errors in /etc/default/grub
and /etc/grub.d/* files or please file a bug report with
/boot/grub/grub.cfg.new file attached.
run-parts: /etc/kernel/postrm.d/zz-update-grub exited with return code 1
dpkg: error processing package linux-image-5.11.0-41-generic (--remove):
installed linux-image-5.11.0-41-generic package post-removal script subpr
ocess returned error exit status 1
dpkg: too many errors, stopping
Errors were encountered while processing:
linux-image-5.11.0-41-generic
Processing was halted because there were too many errors.
E: Sub-process /usr/bin/dpkg returned an error code (1)
How to fix it.
I tried every possibility mentioned below:
autoremove, purge, remove, dpkg, fix broken etc.
How to remove it manually?
Note: My computer is working fine without any problem and booting normal. I can use my laptop but the main problem is that I can't install, remove or fix any packages.