For what it's worth, it seems it might be HOW the script is being called. Testing the apt-auto-removal script here (Kubuntu 15.04) with kernels 3.19.0-29-generic, 3.19.0-30-generic, and 3.19.0-31-generic installed and after a reboot to load -31:
1) Noticed the call to autoremove 3.19.0-30-generic. 2) Read /etc/apt/apt.conf.d/01autoremovekernels and saw -29 and -31 listed as "NeverAutoRemove" 3) Manually removed 3.19.0-29-generic. 4) Ran "sudo /etc/kernel/postinst.d/apt-auto-removal" 5) Re-read /etc/apt/apt.conf.d/01autoremovekernels and saw only -31 listed as "NeverAutoRemove" 6) Ran "sudo /etc/kernel/postinst.d/apt-auto-removal 3.19.0-31-generic" 7) Re-read /etc/apt/apt.conf.d/01autoremovekernels and saw -30 and -31 listed as "NeverAutoRemove" So it worked when called properly in that case. I thought it possible that part of the problem is it's being called with the wrong kernel version. I re-installed -25 and -21 along with -30 and -31. This resulted in -25 and -31 in the never remove list. But again: When apt-auto-removal is re-run with -31, the never remove list changes to -30 and -31. -- 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