My boot partition is on a SSD, so it doesn't have room for more than about 8 installed kernel versions, and eventually some kernel update will fail to install because my boot partition is full of old versions. There are many questions out there about how to remove old versions (even how to automate the process), but my question is simply this: Why doesn't apt-get autoremove detect and remove them automatically, and is there a way I can make it do so? I mean, apt-get is what installed them anyway, so it knows about them, so why does it choose to leave all old versions around?
|
|
|||||||||
|
|
As to answer why , refer to the file
As you can see, apt is told to never autoremove the kernels , as told by another (script) file,
If your script-fu is good enough you could edit it to save only couple kernels, though I can't help you there as my script fu isn't that good Update: In the
So if you compare the output of
So you could comment these out, and it will allow you to auto-remove the kernels with |
|||||||||||||||||||||
|
|
For me it helped to install latest (X)ubuntu (15.10). In earlier releases kernel packages may be marked as manually installed, at least, if installed by using Software Updater, so that In earlier release, you could try to mark kernel packages automatically installed by |
|||||
|
|
Here's a link to a kernel purge script with fail-safe that Dustin Kirkland wrote a few years ago. It should still work on 12.04. http://bazaar.launchpad.net/~bikeshed/bikeshed/trunk/view/head:/purge-old-kernels I was going to test it on my 14.04 machine, but it seems I'm no longer experiencing the problem there (finally fixed via the regular update channel?). So if anyone with a lot of old kernels on his/her machine wants to test it, please do and share your findings. |
|||
|
|
I use this on Ubuntu 12.04! This will keep the current running kernel as well as the newest installed kernel (vmlinuz) and the one before (vmlinuz.old). All other kernels and headers will be removed. |
|||||
|

