GalaxyData Community

remove old boot CentOS / Redhat boot partition full — remove old kernels

If your /boot partition is 100% full on a CentOS/Redhat/Fedora system 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:

yum install yum-utils

Next, check the kernels that you have installed:

rpm -q kernel

 

kernel-2.6.32-279.el6.x86_64
kernel-2.6.32-279.2.1.el6.x86_64
kernel-2.6.32-279.5.2.el6.x86_64
kernel-2.6.32-279.9.1.el6.x86_64

And finally 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 make the following change:

installonly_limit=2

 

Exit mobile version