This post explains how to free up space when files under /var/cache/yum is filling up the disk space. This is normal behavior as the cache would increase its size based on the frequency of syncing with the yum server. Its an administrative task provide adequate space.
This should be corrected by either running:
# yum clean all
The above command cleans all cached files from any enabled repository. It is useful to run this from time to time to make sure there is nothing using unnecessary space.
or you can also use:
# yum clean metadata
This cleans up any xml metadata that may have been cached from any enabled repository.
Possible permanent solutions
Increase the space of the file system.
This would be normal behavior of yum as it does this to speed the process of updating/installing files. If you would like to prevent the FS from filling up you can disable the “yum-updatesd” service as well as, “rhnsd” if enabled, and then re-enabling it when needed.
It can also be accomplished this by running the following commands:
# service yum-updatesd stop # chkconfig yum-updatesd off
# service rhnsd stop # chkconfig rhnsd off
By default yum retains the packages and package data files that it downloads, so that they may be reused in future operations without being downloaded again. This feature can be turned off by modifying the /etc/yum.conf file and changing the option “keepcache” to 0.
keepcache when set to 0, removes packages after installation. Setting keepcache=1 instructs yum to keep the cache of headers and packages after a successful installation.
Another possible solution would be to remove the ‘/var/cache/yum‘ directory or clean up the sub-directories, better if you take a backup in case it is needed later. After removing it, perform a ‘yum check-update‘ and the directory structures will be recreated.
# rm -fr /var/cache/yum
# yum check-update
If none of the above options fix the issue with /var/cache/yum, it might be something related to the specific packages or kernel present in your system. Also, the issue can be related to the repositories or channels registered on your server.