Programster's Blog

Tutorials focusing on Linux, programming, and open-source

CentOS 7 - Remove Old Kernels

If your /boot partition is getting filled, you may wish to automatically remove old kernels. I find the best way to do this is to install the yum utilities package and then use a command to delete all but 2 kernels (just in case there is a problem with the latest one).

sudo yum install yum-utils -y
sudo package-cleanup --oldkernels --count=2

References

Last updated: 13th October 2019
First published: 16th August 2018