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.
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 can surely clean the YUM cache in CentOS.
Also Read :