Main menu

Remove old kernels from CentOS

Your are booting your system and found out that there are too many kernel and options are available for booting. Sometime just your /boot partition is just filled up with old kernels. You need to  remove old kernels

Here in just a quick way we will remove unused old kernel from Linux systems.

Remove old kernels from CentOS/RedHat/Fedora

Install yum utils for automatic removal of kernels.

# yum install yum-utils

Check the installed kernels.

# rpm -q kernel
kernel-tools-3.10.0-229.20.1.el7.x86_64
kernel-3.10.0-229.14.1.el7.x86_64
kernel-3.10.0-229.20.1.el7.x86_64
kernel-headers-3.10.0-229.20.1.el7.x86_64

Remove old kernels and keep only two kernels for safer side. Current and previous.

# package-cleanup --oldkernels --count=2

To make sure only two kernels installed or remain while updating the system. Update your /etc/yum.conf with following changes.

installonly_limit=2

 

FacebookTwitterGoogle+RSS