How to free up space on RHEL6 /boot safely?

Following command will remove ALL kernel versions, except for the one that you’re currently running:

sudo yum remove `rpm -q kernel | grep -v 'uname -r'`

and for going forward, per ⁠7.4. Configuring Yum and Yum Repositories:

⁠installonly_limit=value

…where value is an integer representing the maximum number of versions
that can be installed simultaneously for any single package listed in
the installonlypkgs directive. The defaults for the installonlypkgs
directive include several different kernel packages, so be aware that
changing the value of installonly_limit will also affect the maximum
number of installed versions of any single kernel package. The default
value listed in /etc/yum.conf is installonly_limit=3, and it is not
recommended to decrease this value, particularly below 2.

Leave a Comment