1

Typically I like to have unattended-upgrades enabled in all my Ubuntu 14.04 servers (both security and updates). The relevant configuration line for my question is the following:

// Do automatic removal of new unused dependencies after the upgrade
// (equivalent to apt-get autoremove)
Unattended-Upgrade::Remove-Unused-Dependencies "true";

However, when I check my servers I can see that there are a lot of old kernels still there. Example:

$ apt-get autoremove
...
The following packages will be REMOVED:
  linux-headers-3.13.0-52 linux-headers-3.13.0-52-generic
  linux-headers-3.13.0-57 linux-headers-3.13.0-57-generic
  linux-headers-3.13.0-58 linux-headers-3.13.0-58-generic
  linux-headers-3.13.0-59 linux-headers-3.13.0-59-generic
  linux-image-3.13.0-52-generic linux-image-3.13.0-57-generic
  linux-image-3.13.0-58-generic linux-image-3.13.0-59-generic
  linux-image-extra-3.13.0-52-generic linux-image-extra-3.13.0-57-generic
  linux-image-extra-3.13.0-58-generic linux-image-extra-3.13.0-59-generic

That takes a lot of /boot space and personally I do not have any need to keep old kernels. I assumed that the mentioned config line would take care of this but it does not. What needs to be done in order to clean old kernels?

Raj
  • 11
  • 2

1 Answers1

1

It seems to be a bug with unattended-upgrades. According to the bug report a fix has been implemented but not yet back ported to Ubuntu 14.04.

In the meantime you can always run the command by hand:

apt-get autoremove

You could put apt-get autoremove -y into your crontab.