Xubuntu / Ubuntu remove all old kernels

While installing the new VMware guest program on my Xubuntu VM I noticed the installer working on a large number of old and kernel files. I tried to get the number of old kernels and remove them by script.

To see old kernel files:

To see the currently used kernel:

There is a nice script to automatically remove old kernels and retaining a number of more recent kernels. The script is part of the bikeshed package:

After installing you can call the script


Here is a screenshot of how it actually works:

purge old kernels

purge old kernels


Source: Lubuntu/Documentation/RemoveOldKernels

2 People think it's helpful 😀

Leave a Reply

Your email address will not be published. Required fields are marked *