Download RPM Dependencies Easy Method Handy Tool
Download RPM can be done using wget or curl commands but if you want to download related dependencies then, you have to find out all the dependencies and download all of them is going to be an TDS task. Easy way to download RPM dependencies use yum command or yumdownloader.
How To Download RPM Dependencies
First step is to ensure that you have –downloadonly option enabled in yum, if your using RHEL 7 Or Centos 7 by default it enabled. If your using RHEL 6 Or Centos 6 then run below command
yum install yum-plugin-downloadonly
Now ready to download RPM with dependencies run below command
yum install --downloadonly <Package Name>
by default packages are downloaded into /var/cache/yum/x86_64/7/base/packages if you do not provide any directory path. Simply using –downloaddir=<Directory Path> so that rpms will be downloaded to specified path
yum install --downloadonly --downloaddir=/tmp tigervnc
Sample Output
Total size: 4.7 M Total download size: 239 k Background downloading packages, then exiting: tigervnc-1.8.0-5.el7.x86_64.rpm | 239 kB 00:00:00 exiting because "Download Only" specified
Another Way to Download RPMs yumdownloader
yumdownloader is the best utility to download any RPMs with all dependencies. Install yum utilities to enable yumdownloader command
yum install yum-utils
That’s it ready to download RPMs
yumdownloader <Package Name>
above command will download rpm packages to current directory path, if you want to download other destination path then specify them using below command
yumdownloader --destidir=/tmp httpd
download rpms with all dependencies just use option –resolve
yumdownloader –resolve –destdir=/tmp httpd
GENERAL OPTIONS
-h, –help
Help; display a help message and then quit.
–destdir DIR
Specify a destination directory for the download. Defaults to the current directory.
–urls Instead of downloading RPMs, list the URLs that would be downloaded.
–resolve
When downloading RPMs, resolve dependencies and also download the required packages.
–source
Instead of downloading the binary RPMs, download the source RPMs.
–archlist=ARCH1[,ARCH2…]
Limit the query to packages of given and compatible architectures. Valid values are all architectures known to rpm/yum such as ‘i386’ and ‘src’ for source RPMS. Note that repoquery will now change yum’s “arch” to the first value in the archlist. So “–archlist=i386,i686” will change yum’s canonical arch to i386, but allow packages of i386 and i686.
Note: yumdownloader or yum install –downloadonly are completely depends an Yum repositories. If yum repositories does not have packages your searching for then you have to provide manual URL’s.
Related Articles
Thanks for your wonderful Support and Encouragement