Clean the YUM Cache in CentOS

This article can justify a way to clean the YUM cache in CentOS.

YUM is an abbreviation for Yellowdog Updater, Modifier that could be a free and open-source command-line package-management tool. it’s developed for computers with Linux operating system software uisng the RPM Package Manager.You to automatically update packages and dependency management on RPM-based distribution with the help of YUM. There are possibilities that package could get stored in YUM’s cache even when the package is downloaded, installed or removed. You’ll be able to see that cache packages are mostly found in /var/cache/yum.

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

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

1) Clean all the cached packages placed within the enabled repository cache directory.

yum clean packages

2) Delete the package headers.

yum clean headers

3) Delete metadata of all the enabled repository.

yum clean metadata

4) Clean all the cached information.

yum clean all

That’s it!
Following these steps, you’ll be able to surely clean the YUM cache in CentOS.