5.3.7. Delete old kernels in CentOS and Fedora (free up space in /boot)

Attention!

The kernel deletion procedure is irreversible. Be sure to test the current kernel for functionality before deleting it.

You can view a list of all installed kernels using the following command:

rpm -q kernel

Install yum-utils:

yum install yum-utils -y

Delete unnecessary kernels by doing the following:

package-cleanup --oldkernels --count=2

Where --count=2 is the number of system cores to keep (2 in this example).

To automatically delete kernels during updates, you need to change the installonly_limit setting in /etc/yum.conf:

installonly_limit=3

Attention!

You should not set the installonly_limit value too low (especially below 2), as this may cause the server to stop working after an update.
Tabla de conținut