How to Remove YUM Cache on Linux

Clean YUM cache files on Linux to free disk space and reduce package manager clutter with Kudu.

By Kudu Team

Fix this automatically with Kudu

Run a free system scan to detect and resolve this issue automatically — no manual steps required.

Download Kudu Free →

What Causes This?

YUM stores downloaded package files, metadata, and headers in a local cache so it can work faster the next time you install or update software. Over time, that cache can grow large, especially on systems that are updated often or have many repositories enabled. Old package data can also stick around after updates, taking up disk space and adding unnecessary clutter.

Common Symptoms

  • Disk space is lower than expected on your Linux system
  • /var/cache/yum is using a large amount of storage
  • YUM or DNF feels slower when checking repositories
  • You want to remove old package files after updates
  • System cleanup tools report package manager cache bloat

How to Fix It Manually

  1. Open a terminal.

    • On most Linux distributions, you can open Terminal from the applications menu.
    • You can also often use the shortcut Ctrl+Alt+T.
  2. Check how much space the YUM cache is using.

    • Run:
      du -sh /var/cache/yum
    • If your system uses DNF, you may also want to check:
      du -sh /var/cache/dnf
  3. Clean cached package files with YUM.

    • Run:
      sudo yum clean packages
    • This removes downloaded package files but keeps metadata.
  4. Remove cached metadata and headers if you want a deeper cleanup.

    • Run:
      sudo yum clean metadata
      sudo yum clean headers
    • This can help reduce clutter further, but YUM will download fresh metadata again the next time you use it.
  5. Clear all YUM cache files at once.

    • If you want the most complete cleanup, run:
      sudo yum clean all
    • This removes packages, metadata, and headers from the YUM cache.
  6. Verify that the cache was removed.

    • Check the folder size again:
      du -sh /var/cache/yum
    • You should see a much smaller size after cleanup.
  7. If your system uses DNF instead of YUM, clean that cache too.

    • Run:
      sudo dnf clean all
    • Many newer Fedora, RHEL, and CentOS-based systems use DNF even if people still refer to it as YUM.
  8. Rebuild cache only if needed.

    • If you want to refresh repository data right away, run:
      sudo yum makecache
    • Or on DNF systems:
      sudo dnf makecache

If cleanup does not seem to free space, check whether old packages are being stored elsewhere, or whether another package manager is using its own cache directory.

Fix It Automatically with Kudu

If you do not want to hunt through cache folders and run cleanup commands yourself, Kudu can detect unnecessary package manager cache files and remove them automatically as part of a broader system cleanup. It is a faster way to recover space and reduce clutter without guessing which files are safe to delete.

Download Kudu Free →

Fix this automatically with Kudu

Run a free system scan to detect and resolve this issue automatically — no manual steps required.

Download Kudu Free →