Friday, April 19, 2019

package management - What is Ubuntu's policy on keeping old kernels




I've just run out of disk space on /. Looking into the situation I realised that since first installing 12.04, Ubuntu has upgraded the kernel ~23 times and has kept every old kernel, binaries and header sources.



I've just manually apt-get purge-ed all but the last couple, saving ~4Gb space (on a 20Gb partition, so that's v. significant). Why would Ubuntu want to keep all of those? Is it lack of a feature such as "keep last 4" or is there some other reason?



Ubuntu used to keep the old kernels around for safety reasons, however it should be autocleaning old kernels now.



The system should be auto cleaning old kernels per this bug:






So you might want to ensure that your system is up to date and that you have apt (0.9.7.5ubuntu5.5) installed. If you're still getting the wrong behavior then please report a bug on the apt package.



This is also useful if you want to clean up stuff:





You don't need to manually purge each kernel package, doing a sudo apt-get autoremove every once in a while will remove kernels you don't need anymore. However finding the root cause as to why your system isn't autocleaning old kernels is probably easier.


No comments:

Post a Comment

11.10 - Can't boot from USB after installing Ubuntu

I bought a Samsung series 5 notebook and a very strange thing happened: I installed Ubuntu 11.10 from a usb pen drive but when I restarted (...