How to Download a specific version of the RPM package along with its dependencies
Use the –showduplicates to see all the installed packages and the available packages
# yum --showduplicates list [package_name]
root@funoel7:~# yum --showduplicates list httpd
Loaded plugins: langpacks, ulninfo
Installed Packages
httpd.x86_64 2.4.6-45.0.1.el7_3.4 @ol7_latest
Available Packages
httpd.x86_64 2.4.6-80.0.1.el7 ol7_latest
httpd.x86_64 2.4.6-80.0.1.el7_5.1 ol7_latest
httpd.x86_64 2.4.6-88.0.1.el7 ol7_latest
httpd.x86_64 2.4.6-89.0.1.el7_6 ol7_latest
httpd.x86_64 2.4.6-89.0.1.el7_6.1 ol7_latest
httpd.x86_64 2.4.6-90.0.1.el7 ol7_latest
httpd.x86_64 2.4.6-93.0.1.el7 ol7_latest
httpd.x86_64 2.4.6-95.0.1.el7 ol7_latest
httpd.x86_64 2.4.6-97.0.1.el7_9 ol7_latest
Solution 1:
Download the packages into a local directory
yum install --downloadonly --downloaddir=[directory] [package] [version]
yum install --downloadonly --downloaddir=/tmp/ httpd.x86_64 2.4.6-97.0.1.el7_9
Sample Output:
All dependencies are also downloaded.
root@funoel7:/tmp# ls -ltr *.rpm
-rw-r--r-- 1 root root 116596 Nov 10 20:41 mod_ssl-2.4.6-97.0.1.el7_9.x86_64.rpm
-rw-r--r-- 1 root root 94932 Nov 10 20:41 httpd-tools-2.4.6-97.0.1.el7_9.x86_64.rpm
-rw-r--r-- 1 root root 1246132 Nov 10 20:41 httpd-2.4.6-97.0.1.el7_9.x86_64.rpm
-rw-r--r-- 1 root root 504732 Dec 16 16:58 openssl-1.0.2k-21.el7_9.x86_64.rpm
-rw-r--r-- 1 root root 1254216 Dec 16 16:58 openssl-libs-1.0.2k-21.el7_9.x86_64.rpm
Solution 2:
Download package with its dependencies using yumdownloader
# yumdownloader [package]
#yumdownloader --destdir=[DIR] [package]
yumdownloader --destdir=/tmp httpd.x86_64 2.4.6-97.0.1.el7_9
download the packe along with all dependencies, use option "--resolve" along with "- -destdir"
yumdownloader --destdir=[DIR] --resolve [package]
Post a Comment
Post a Comment