2011-06-14

Enabling Caching Yum Downloads on Linux

I needed to copy the packages and updates performed on a Scientific Linux 6.0 x86_64 (call it A, connected to Internet) to another server(call it B). This second server has no Internet connection, and can not access to repositories but it is the main server in a project. So, I am keeping the server A as "mirror" of the server B. By this way, I can copy the updates as RPM files from server A to the unconnected server B.

Here is what I did to perform it using Yum:
First, make sure that the downloaded packages are cached in server A, that is, they are not deleted after the installation. To do that become root and type

vi /etc/yum.conf

And edit the line starting with keepcache, make sure that it is like this:

keepcache=1

Note your cachedir there.
It is defined as

cachedir=/var/cache/yum/$basearch/$releasever

It is expanded in my system as:

/var/cache/yum/x86_64/6.0/sl/packages

Now, whenever you use yum from command line or GUI, the downloaded packages can be found there and copied freely.

No comments:

Post a Comment