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/yumis 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
-
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.
-
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
- Run:
-
Clean cached package files with YUM.
- Run:
sudo yum clean packages - This removes downloaded package files but keeps metadata.
- Run:
-
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.
- Run:
-
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.
- If you want the most complete cleanup, run:
-
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.
- Check the folder size again:
-
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.
- Run:
-
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 you want to refresh repository data right away, run:
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.
Fix this automatically with Kudu
Run a free system scan to detect and resolve this issue automatically — no manual steps required.
Download Kudu Free →Related guides
How to Remove App Cache on Linux
Clean application cache on Linux to recover space and reduce clutter using Kudu.
How to Remove APT Cache on Linux
Free up storage by cleaning APT cache files on Linux with Kudu’s cleanup tools.
How to Remove Browser Cache on Linux
Delete browser cache on Linux to free up storage and improve browsing performance with Kudu.
How to Remove DNF Cache on Linux
Delete DNF cache on Linux and reclaim storage space safely using Kudu’s cleanup tools.