CentOS / Redhat boot partition full – remove old kernels

Sometimes /boot partition gets 100% full on a CentOS/Redhat/Fedora system. To resolve this you can use a yum-utils package to clean up older kernels and configure yum not to keep too many versions.

First, make sure yum-utils is installed on your system:

yum install yum-utils

Next, check the list of kernels that you have installed:

rpm -q kernel

Now to keep only two of the latest kernels, run:

package-cleanup --oldkernels --count=2

To make the change permanent when installing / updating kernels via yum, edit the /etc/yum.conf file and update the following parameter:


That’s all we have to do. You also like to know How To Install Plesk Panel For Linux. Please check and give your opinion below if you experience any issues or to discuss your ideas and experiences.