Knowledge Base
MilesWeb / Web Hosting FAQ

Clean the YUM Cache in CentOS

Approx. read time : 2 min

This article will explain how to clean the YUM cache in CentOS.

YUM is an abbreviation for Yellowdog Updater, Modifier which is a free and open-source command-line package-management tool. It is developed for computers with Linux Operating System using the RPM Package Manager. YUM enables you to automatically update packages and dependency management on RPM-based distribution. There are chances that package may get stored in YUM’s cache even after the package is downloaded, installed or removed. You can see that cache packages are mostly found in /var/cache/yum.

You may need to clear the YUM cache to make some space on disk or to fix errors that occurred due to corrupted metadata files.

To clear YUM cache you need to be logged in to the server as root user and then execute following commands.

1) Clean all the cached packages located in the enabled repository cache directory.

2) Delete the package headers.

3) Delete metadata of all the enabled repository.

4) Clean all the cached information.

That’s it!

Following these steps, you can surely clean the YUM cache in CentOS.

Also Read :

1) How To Clear WordPress Cache?

2) Learn to clear the local DNS cache in Linux

Sonam Wagh
With an interest in doing something creative daily, Sonam works as a Digital Marketing Executive. She likes to write technical blogs related to web hosting, digital marketing, and other IT topics. She also likes to spend her leisure time on social media to find different strategies for client engagement.
Need help? We’re always here for you.