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

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.