I noticed today that my linux images were stacking up on the hard drive (Ubuntu Server 12.04). I freed up a couple of GB in clearing the majority of them off.
When I looked into this there is a script in place to protect the current version (current running, most recent, second most recent). This is run automatically each time a new linux image is added through apt: /etc/kernel/postinst.d/apt-auto-removal
. It's effect is to prevent the most relevant images from being removed automatically through apt.
However this did not explain the number of images I had filling up my /boot
partition. This appears due to each linux-image-*-generic
being marked as manual
in apt so that you need to use apt-mark auto linux-image-3.2.0-32-generic
before it will be identified for removal.
Is there any simple way to change this behavior so that kernels are only retained by the logic in /etc/kernel/postinst.d/apt-auto-removal
? Is it inadvisable to try?