The problem is that on purge/removal the linux-image-extra package runs all the kernel post-*install*-hooks in /etc/kernel/postinst.d (as its postrm hook), including the /etc/kernel/postinst.d/apt-auto-removal hook. The 'to-be-removed'-version of the kernel is given as an argument and thereby added to the list /etc/apt/apt.conf.d/01autoremove-kernels of kernels which shall not be autoremoved. Which at this point is clearly wrong, since we are probably just right now removing the respective kernel (linux-image) version as well.
This bug was introduced as a fix to #1375310 (https://bugs.launchpad.net/ubuntu/+source/linux/+bug/1375310). A fix is not so obvious for me, as running some /etc/kernel/postinst.d/ hooks might be required upon removal of a specific version of the linux- extra-image, if the corresponding linux-image package is not going to be removed. But just running blindly all kernel-postinst hooks on removal of a package does not really seem like a good idea to me. Regards, Robert. -- You received this bug notification because you are a member of Ubuntu Bugs, which is subscribed to Ubuntu. https://bugs.launchpad.net/bugs/1440608 Title: /etc/kernel/postinst.d/apt-auto-removal wants to remove all kernels except the latest one To manage notifications about this bug go to: https://bugs.launchpad.net/ubuntu/+source/apt/+bug/1440608/+subscriptions -- ubuntu-bugs mailing list ubuntu-bugs@lists.ubuntu.com https://lists.ubuntu.com/mailman/listinfo/ubuntu-bugs