Monday, 16 December 2013

Download RPM Packages For Offline Installation On Multiple Machines

Linux is operating system where stability depends on updated software packages.Many of us install apps and updates daily on Redhat System.There is possibility that system may crash or get corrupted so it is best to have backup.If you want to install packages on multiple machines having same Operating system version you can save internet bandwidth and time by  downloading packages from one system and then copying those packages and installing on other similar machine having same REDHAT or FEDORA version.


Following is the easy way to do it from terminal


Open terminal and Type following

yum install yum-utils
#to download rpm packages resolving from yum 



yumdownloader --resolve --urls <pkg1> <pkg2> ..<pkgN> | grep 'http:' >dwldpkg.txt

Similairly for Downloading updates you need redirect output of 'yum list updates' to text file

yum list updates | sed -n '/^Updated/,$p' | sed -n '2 ,$ p' | awk '{ print $1 }' >  updatespkgnames.txt


yumdownloader --resolve --urls ` cat updatespkgnames.txt |   cut -d " " -f1` | grep 'http:' > rpmsurlslist.txt


After Downloading Packages to install them using terminal

yum localinstall *.rpm

No comments:

Post a Comment