[Seek Help] Unable to remove old linux kernel
Tofloor
poster avatar
robertsala
deepin
2022-10-04 15:54
Author

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.

Reply Favorite View the author
All Replies
robertsala
deepin
2022-10-04 15:57
#1

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

Reply View the author
robertsala
deepin
2022-10-04 16:09
#2

linux-headers-5.18.4-amd64-desktop-hwe/unknown,apricot,now 5.18.4-amd64-desktop-hwe-23.01.00.02 amd64 [installed,automatic]
linux-headers-5.19.12-xanmod1/unknown,now 5.19.12-xanmod1-020220928.git8155aed8 amd64 [installed]
linux-headers-5.19.9-xanmod1/unknown,now 5.19.9-xanmod1-0
20220916.git5cf14a5 amd64 [installed]
linux-image-5.18.17-amd64-desktop-hwe/apricot,now 5.18.17-amd64-desktop-hwe-20.01.00.01 amd64 [installed]
linux-image-5.18.4-amd64-desktop-hwe/unknown,apricot,now 5.18.4-amd64-desktop-hwe-23.01.00.02 amd64 [installed,automatic]

Reply View the author
ni******[email protected]
deepin
2022-10-06 19:45
#3
It has been deleted!