Thursday, 9 January 2020

How to Clean YUM Cache on CentOS 7




Yum (Yellow Dog Update Modifire) is a tool for RPM package management. Yum can install RPM packages and dependencies are obtained and downloaded automatically.

By default YUM Cache set to remove packages after successful installation and can be save the packages by changing the parameter from 0 to 1 in /etc/yum.conf yum configuration file:

[root@linuxcnf ~]# vi /etc/yum.conf
[main]
...............
keepcache=1
...............
[root@linuxcnf ~]#

To clean all the saved packages run the following command it will help to reclaim used space:

[root@linuxcnf ~]# yum clean packages
Loaded plugins: fastestmirror
Cleaning repos: base extras updates
0 package files removed
[root@linuxcnf ~]#

To Clean Metadata, run the following command:

[root@linuxcnf ~]# yum clean metadata
Loaded plugins: fastestmirror
Cleaning repos: base extras updates
10 metadata files removed
6 sqlite files removed
0 metadata files removed
[root@linuxcnf ~]#

To clean package headers, run the flowing command:

[root@linuxcnf ~]# yum clean headers
Loaded plugins: fastestmirror
Cleaning repos: base extras updates
0 header files removed
[root@linuxcnf ~]#

To clean all cached information, run the yum clean all command:

[root@linuxcnf ~]# yum clean all
Loaded plugins: fastestmirror
Cleaning repos: base extras updates
Cleaning up everything
Cleaning up list of fastest mirrors
[root@linuxcnf ~]#

Done!!! All the yum cached data and information is deleted.

No comments:

Post a comment