How to retain RPMs downloaded by yum
In Category Fedora Linux RedHat
Generally yum deletes all RPMs it downloads right after installing them. If you want to save Internet bandwidth and have multiple systems to be updated, you can make yum to keep the RPMs it downloads.
The highlighted line in /etc/yum.conf file can be edited to enable yum keep the cache of RPMs.
[main] cachedir=/var/cache/yum #keepcache=0 keepcache=1 ..
The “keepcache=1” tells yum to not remoe downloaded RPMs. But where are those downloaded RPMS? You can see “cachedir” line in /etc/yum.conf and that is the base directory where yum keeps the RPMs. In this case the cache directory is “/var/cache/yum“.
You can use “find” command as shown below to find the list of RPMs present in the cache.
[root@techpulp ~]# find /var/cache/yum -iname \*.rpm /var/cache/yum/fedora/packages/libmp4v2-1.5.0.1-6.fc10.i386.rpm /var/cache/yum/fedora/packages/pyxdg-0.16-1.fc10.noarch.rpm /var/cache/yum/fedora/packages/libfreebob-1.0.11-3.fc10.i386.rpm /var/cache/yum/fedora/packages/wildmidi-libs-0.2.2-5.fc10.i386.rpm /var/cache/yum/fedora/packages/freeglut-2.4.0-14.fc9.i386.rpm [root@techpulp ~]#
If you want to install exactly same set of RPMs in another and similar PC, you can create a tarball as shown below and transfer the tarball to another system.
[root@techpulp ~]# find /var/cache/yum -iname \*.rpm | xargs tar -zcvf delta-rpms.tgz /var/cache/yum/fedora/packages/libmp4v2-1.5.0.1-6.fc10.i386.rpm /var/cache/yum/fedora/packages/pyxdg-0.16-1.fc10.noarch.rpm /var/cache/yum/fedora/packages/libfreebob-1.0.11-3.fc10.i386.rpm /var/cache/yum/fedora/packages/wildmidi-libs-0.2.2-5.fc10.i386.rpm /var/cache/yum/fedora/packages/freeglut-2.4.0-14.fc9.i386.rpm [root@techpulp ~]#
The above command generates delta-rpms.tgz which should be transferred to new system and in the new system, you can use following method to install all the RPMs at once.
[root@newsys ~]# mkdir Temp [root@newsys ~]# cd Temp [root@newsys ~]# tar -zxvf ~/delta-rpms.tgz [root@newsys ~]# find . -iname \*.rpm | xargs rpm -i --nodeps [root@newsys ~]#
Recent Comments