Ubuntu - Manually Remove Old Kernels

For some reason, sudo apt-get autoremove often does not remove a lot of the old kernels. One will need to manually remove them if you are running out of space on your /boot partition.

Simply run

sudo apt-get purge linux-image-x.x.x.x-generic  

Replace x.x.x.x with something like 3.13.0-63 when you see initrd.img-3.13.0-62-generic listed in /boot.

Be careful not to remove the very latest kernel!

When you are finished removing kernels, be sure to update your grub boot loader.

sudo update-grub2  

References

Author

Programster

Stuart is a software developer with a passion for Linux and open source projects.

comments powered by Disqus