Documentation

Clear Out Old Kernels

Categories
A
Adam Birds
Published 10 August 20261 min read2 views

To clear out the old kernels from a CentOS box use the following commands:

yum install yum-utils
package-cleanup --oldkernels --count=2

To stop the /boot partition from filling again do the following

add installonly_limit=2 to /etc/yum.conf

To clear out the old kernels from a Ubuntu box use the following commands:

apt-get autoremove --purge
Last updated: 10 August 2026v1