This morning I spent time updating the various VM images I use with bug and security fixes.  My CentOS 7 VM presented a notice to me that it’s /boot partition was nearly out of disk space.

Normally a quick reference and delete of the older files would address the immediate need to free-up disk space; however this would not address the long term management of running out of disk space (again) as updates are applied.   There is also the question of breaking package management continuity by removing files by hand.

Quick Internet search took me to a blog entry which addressed this very topic.

By default CentOS 7 will keep up to 5 different versions of an installed package laying around.  Interestingly, the yum.conf man page says that the default value is 3 different package versions.  Yet the value I found in the CentOS 7 yum.conf file was 5.  Go figure.

So two things…

  1. I set the Yum configuration to keep only 2 copies.
    shell# vi /etc/yum.conf
    (save and exit)
  2. I purged the older kernel files in the /boot directory using package-cleanup tool.
    shell# package-cleanup --oldkernels --count=2

This took care of me.  Please visit to see output from the before, during and after using package-cleanup.

Last modified: 01/23/2016


Write a Reply or Comment