For some operations (for example, a yum install operation), Yum downloads the packages to install into the Yum cache. The cached packages are located in a subdirectory structure from /var/cache/yum that reflects the architecture, the distribution release, and the repository from where the packages were downloaded.
Jagadeesh, pages in cache would get re-claimed by memory management sub-system as and when required and this is managed by kernel. There is this famous saying 'un-used memory in linux is a wasted memory', so kernel would keep pages which are read/written from disk in primary memory which is RAM for latter re-use and this gets filled up as system usage grows. If space is needed by programs or applications like Oracle, then Linux will free up the buffers and cache to yield memory for the applications. If your system runs for a while you will usually see a small number under the field “free” on the first line. Shell Script for Linux clear cache: clearRAM.sh.
After successful installation, the packages are deleted from the cache. To retain the cached packages, change the keepcache setting to 1 in the /etc/yum.conf file as follows:
Cleaning the Yum Cache
Clean the Yum cache to reclaim disk space or to clear errors due to corrupted metadata files. To remove cached packages only, use:
To delete metadata for each enabled repository, use the following command:
To delete package headers, use the following command:
To clean all cached information, use the following command:
If you get the message “Metadata file does not match checksum” during a Yum operation, clearing the metadata from the cache might not help. In this case, adding the following line to /etc/yum.conf resolves the problem:
Changing default location of yum cache
Sometimes when the default yum cache location is full, you would get an error while installing any yum package.
As the /var filesystem where yum cache is located is full and there is no disk space for yum to download the system updates, the above error will be shown.
Clear Dns Cache Centos
The yum cache location is configured in /etc/yum.conf file as cachedir option in the [main] section and can be changed: