Comment 5 for bug 1637797

Revision history for this message
Marius Gedminas (mgedmin) wrote :

I accidentally ran apt-get autoremove twice on a couple of Ubuntu 14.04 LTS servers, and it removed the stale kernel (on 1st run) and the old kernel (on 2nd run), leaving the latest kernel the only one available in /boot.

The .old kernel was linux-headers-3.13.0-139-generic, and if I look at /etc/apt/apt.conf.d/01autoremove-kernels, I see that it should've been kept:

// DO NOT EDIT! File autogenerated by /etc/kernel/postinst.d/apt-auto-removal
APT::NeverAutoRemove
{
   "^linux-image-3\.13\.0-139-generic$";
   "^linux-image-3\.13\.0-141-generic$";
   "^linux-headers-3\.13\.0-139-generic$";
   "^linux-headers-3\.13\.0-141-generic$";
   "^linux-image-extra-3\.13\.0-139-generic$";
   "^linux-image-extra-3\.13\.0-141-generic$";
   "^linux-signed-image-3\.13\.0-139-generic$";
   "^linux-signed-image-3\.13\.0-141-generic$";
   "^kfreebsd-image-3\.13\.0-139-generic$";
   "^kfreebsd-image-3\.13\.0-141-generic$";
   "^kfreebsd-headers-3\.13\.0-139-generic$";
   "^kfreebsd-headers-3\.13\.0-141-generic$";
   "^gnumach-image-3\.13\.0-139-generic$";
   "^gnumach-image-3\.13\.0-141-generic$";
   "^.*-modules-3\.13\.0-139-generic$";
   "^.*-modules-3\.13\.0-141-generic$";
   "^.*-kernel-3\.13\.0-139-generic$";
   "^.*-kernel-3\.13\.0-141-generic$";
   "^linux-backports-modules-.*-3\.13\.0-139-generic$";
   "^linux-backports-modules-.*-3\.13\.0-141-generic$";
   "^linux-tools-3\.13\.0-139-generic$";
   "^linux-tools-3\.13\.0-141-generic$";
};

The timestamp of /etc/kernel/postinst.d/apt-auto-removal is very recent, so I cannot guarantee that it had the same contents at the time of my second apt-get autoremove run.

(Thankfully, running apt-get autoremove for the third time does not try to remove my current--and only--kernel.)