I want to keep 5.18.4.
dpkg --list | grep linux-image
rH linux-image-5.18.17-amd64-desktop-hwe 5.18.17-amd64-desktop-hwe-20.01.00.01 amd64 Linux kernel, version 5.18.17-amd64-desktop-hwe
ii linux-image-5.18.4-amd64-desktop-hwe 5.18.4-amd64-desktop-hwe-23.01.00.02 amd64 Linux kernel, version 5.18.4-amd64-desktop-hwe
ic linux-image-unsigned-6.0.0-060000rc3-generic 6.0.0-060000rc3.202208282331 amd64 Linux kernel image for version 6.0.0 on 64 bit x86 SMP
HI,
I am unable to remove the linux kernels that I do not want.
This is just trying to remove one of the linux kernels;
The following packages will be REMOVED:
linux-image-5.18.17-amd64-desktop-hwe
0 upgraded, 0 newly installed, 1 to remove and 0 not upgraded.
1 not fully installed or removed.
After this operation, 356 MB disk space will be freed.
Do you want to continue? [Y/n] y
(Reading database ... 281109 files and directories currently installed.)
Removing linux-image-5.18.17-amd64-desktop-hwe (5.18.17-amd64-desktop-hwe-20.01.00.01) ...
update-initramfs: Deleting /boot/initrd.img-5.18.17-amd64-desktop-hwe
Searching for GRUB installation directory ... found: /boot/grub
/etc/default/grub: line 1: #: command not found
run-parts: /etc/kernel/postrm.d/zz-update-grub exited with return code 127
dpkg: error processing package linux-image-5.18.17-amd64-desktop-hwe (--remove):
installed linux-image-5.18.17-amd64-desktop-hwe package post-removal script subprocess returned error exit status 1
Errors were encountered while processing:
linux-image-5.18.17-amd64-desktop-hwe
E: Sub-process /usr/bin/dpkg returned an error code (1)
Please help. Nothing has worked.