I am trying to remove old kernels in an encrypted system. I am getting kernels marked for purge, but installed after my efforts.
I start with removing leftover temporary files from previous kernel updates
$ sudo rm -rv ${TMPDIR:-/var/tmp}/mkinitramfs-*
My current version number is 4.4.0-127-generic
Here is my list currently after several attempts. I'm trying to keep 127 (my current version, and 124)
$ dpkg -l | tail -n +6 | grep -E 'linux-image-[0-9]+'
pi linux-image-4.4.0-112-generic 4.4.0-112.135 amd64 Linux kernel image for version 4.4.0 on 64 bit x86 SMP
pi linux-image-4.4.0-116-generic 4.4.0-116.140 amd64 Linux kernel image for version 4.4.0 on 64 bit x86 SMP
pi linux-image-4.4.0-119-generic 4.4.0-119.143 amd64 Linux kernel image for version 4.4.0 on 64 bit x86 SMP
pi linux-image-4.4.0-121-generic 4.4.0-121.145 amd64 Linux kernel image for version 4.4.0 on 64 bit x86 SMP
ii linux-image-4.4.0-122-generic 4.4.0-122.146 amd64 Linux kernel image for version 4.4.0 on 64 bit x86 SMP
ii linux-image-4.4.0-124-generic 4.4.0-124.148 amd64 Linux kernel image for version 4.4.0 on 64 bit x86 SMP
ii linux-image-4.4.0-127-generic 4.4.0-127.153 amd64 Linux kernel image for version 4.4.0 on 64 bit x86 SMP
So, say I try to remove 4.4.0-119
I free space in boot by removing initrd.img file
$ sudo update-initramfs -d -k 4.4.0-119-generic
update-initramfs: Deleting /boot/initrd.img-4.4.0-119-generic
I try purging the kernal
$ sudo dpkg --purge linux-image-4.4.0-119-generic linux-image-extra-4.4.0-119-generic
dpkg: dependency problems prevent removal of linux-image-4.4.0-119-generic:
linux-signed-image-4.4.0-119-generic depends on linux-image-4.4.0-119-generic (= 4.4.0-119.143).
dpkg: error processing package linux-image-4.4.0-119-generic (--purge):
dependency problems - not removing
(Reading database ... 513541 files and directories currently installed.)
Removing linux-image-extra-4.4.0-119-generic (4.4.0-119.143) ...
run-parts: executing /etc/kernel/postinst.d/apt-auto-removal 4.4.0-119-generic /boot/vmlinuz-4.4.0-119-generic
run-parts: executing /etc/kernel/postinst.d/dkms 4.4.0-119-generic /boot/vmlinuz-4.4.0-119-generic
run-parts: executing /etc/kernel/postinst.d/initramfs-tools 4.4.0-119-generic /boot/vmlinuz-4.4.0-119-generic
update-initramfs: Generating /boot/initrd.img-4.4.0-119-generic
run-parts: executing /etc/kernel/postinst.d/pm-utils 4.4.0-119-generic /boot/vmlinuz-4.4.0-119-generic
run-parts: executing /etc/kernel/postinst.d/unattended-upgrades 4.4.0-119-generic /boot/vmlinuz-4.4.0-119-generic
run-parts: executing /etc/kernel/postinst.d/update-notifier 4.4.0-119-generic /boot/vmlinuz-4.4.0-119-generic
run-parts: executing /etc/kernel/postinst.d/zz-update-grub 4.4.0-119-generic /boot/vmlinuz-4.4.0-119-generic
Generating grub configuration file ...
Warning: Setting GRUB_TIMEOUT to a non-zero value when GRUB_HIDDEN_TIMEOUT is set is no longer supported.
Found linux image: /boot/vmlinuz-4.4.0-127-generic
Found initrd image: /boot/initrd.img-4.4.0-127-generic
Found linux image: /boot/vmlinuz-4.4.0-124-generic
Found initrd image: /boot/initrd.img-4.4.0-124-generic
Found linux image: /boot/vmlinuz-4.4.0-122-generic
Found initrd image: /boot/initrd.img-4.4.0-122-generic
Found linux image: /boot/vmlinuz-4.4.0-121-generic
Found initrd image: /boot/initrd.img-4.4.0-121-generic
Found linux image: /boot/vmlinuz-4.4.0-119-generic
Found initrd image: /boot/initrd.img-4.4.0-119-generic
Found linux image: /boot/vmlinuz-4.4.0-116-generic
Found initrd image: /boot/initrd.img-4.4.0-116-generic
Found linux image: /boot/vmlinuz-4.4.0-112-generic
done
Purging configuration files for linux-image-extra-4.4.0-119-generic (4.4.0-119.143) ...
Errors were encountered while processing:
linux-image-4.4.0-119-generic
Doing this changes the status of the kernel to pi. This is the method I used previously to remove old kernels. I'm not sure what changed here.
No comments:
Post a Comment