In this tutorial, you’ll learn the basics of how to clear the yum cache. But first:
What is yum?
The Yellowdog Updater, Modified (yum) is an open-source command-line package-management utility for Linux operating systems using the RPM Package Manager. Yum allows automatic updates, package and dependency management, on RPM-based distributions. Like the Advanced Packaging Tool (APT) from Debian, yum works with software repositories (collections of packages), which can be accessed locally or over a network connection. Under the hood, yum depends on RPM, which is a packaging standard for digital distribution of apps, which automatically uses hashes and digisigs to verify the authorship and integrity of such apps; unlike some app stores, which serve a similar function, yum nor RPM provide built-in support for proprietary restrictions on copying of packages by endusers. Yum is implemented as libraries in the Python programming language, with a small set of programs that provide a command-line interface. GUI-based wrappers such as yumex also exist.
How to clear the yum cache:
When a package is downloaded, installed and is removed there is a chance that the package may still be saved/stored in the yum’s cache. So to clean all the cached packages from the enabled repository cache directory, login as root and execute the following:
yum clean packages
To purge the old package information completely, execute the following command:
yum clean headers
To clean any cached xml metadata from any enabled repository, execute the following
yum clean metadata
If you wish to clean all the cached files from any enabled repository at once, execute the
yum clean all