• Skip to primary navigation
  • Skip to main content
  • Skip to primary sidebar
  • Skip to footer navigation

The Geek Diary

  • OS
    • Linux
    • CentOS/RHEL
    • Solaris
    • Oracle Linux
    • VCS
  • Interview Questions
  • Database
    • oracle
    • oracle 12c
    • ASM
    • mysql
    • MariaDB
  • DevOps
    • Docker
    • Shell Scripting
  • Big Data
    • Hadoop
    • Cloudera
    • Hortonworks HDP

/var/cache/yum Constantly Filling Files System in CentOS/RHEL

by admin

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

Option 1

Increase the space of the file system.

Option 2

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

Option 3

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.

Option 4

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

Final Thoughts

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.

Filed Under: CentOS/RHEL 5, CentOS/RHEL 6, CentOS/RHEL 7, Fedora, Linux

Some more articles you might also be interested in …

  1. mt Command Examples in Linux
  2. CentOS / RHEL 7 : How to open the Firewall port for Samba server using FirewallD
  3. CentOS / RHEL 5 : dm-multipath file /etc/sysconfig/mkinitrd/multipath explained
  4. ac Command Examples in Linux
  5. megatools-dl Command Examples in Linux
  6. How to recover deleted Logical volume (LV) in LVM using vgcfgrestore
  7. Upgrading from CentOS/RHEL 7 to CentOS/RHEL 8 using Leapp
  8. head Command Examples in Linux
  9. How to disable ACPI in CentOS/RHEL 7
  10. How to install and configure “setroubleshootd” on CentOS/RHEL

You May Also Like

Primary Sidebar

Recent Posts

  • qsub Command Examples in Linux
  • qsub: command not found
  • qrcp Command Examples in Linux
  • qmrestore Command Examples in Linux

© 2023 · The Geek Diary

  • Archives
  • Contact Us
  • Copyright