How to download only RPM with dependencies using yum ?

In this article, we will see how to download rpm packages with dependencies using yum.

The trick is very useful especially for servers where the repo is not reachable.

Lets see how to download these packages.

Resolve the package with dependencies and download it

[root@ngelinux ~]# yumdownloader leapp --resolve
Loaded plugins: kabi, langpacks, product-id, subscription-manager, versionlock

This system is not registered with an entitlement server. You can use subscription-manager to register.

Loading support for Red Hat kernel ABI
--> Running transaction check
---> Package leapp.noarch 0:0.17.0-1.el7_9 will be installed
--> Processing Dependency: python2-leapp = 0.17.0-1.el7_9 for package: leapp-0.17.0-1.el7_9.noarch
--> Processing Dependency: leapp-repository for package: leapp-0.17.0-1.el7_9.noarch
--> Running transaction check
---> Package leapp-upgrade-el7toel8.noarch 0:0.20.0-2.el7_9 will be installed
--> Processing Dependency: leapp-repository-dependencies = 10 for package: leapp-upgrade-el7toel8-0.20.0-2.el7_9.noarch
---> Package python2-leapp.noarch 0:0.17.0-1.el7_9 will be installed
--> Processing Dependency: leapp-framework-dependencies = 5 for package: python2-leapp-0.17.0-1.el7_9.noarch
--> Running transaction check
---> Package leapp-deps.noarch 0:0.17.0-1.el7_9 will be installed
---> Package leapp-upgrade-el7toel8-deps.noarch 0:0.20.0-2.el7_9 will be installed
--> Processing Dependency: dnf >= 4 for package: leapp-upgrade-el7toel8-deps-0.20.0-2.el7_9.noarch
--> Running transaction check
---> Package dnf.noarch 0:4.0.9.2-2.el7_9 will be installed
--> Processing Dependency: python2-dnf = 4.0.9.2-2.el7_9 for package: dnf-4.0.9.2-2.el7_9.noarch
--> Running transaction check
---> Package python2-dnf.noarch 0:4.0.9.2-2.el7_9 will be installed
--> Processing Dependency: dnf-data = 4.0.9.2-2.el7_9 for package: python2-dnf-4.0.9.2-2.el7_9.noarch
--> Processing Dependency: python2-libdnf >= 0.22.5 for package: python2-dnf-4.0.9.2-2.el7_9.noarch
--> Processing Dependency: python2-libcomps >= 0.1.8 for package: python2-dnf-4.0.9.2-2.el7_9.noarch
--> Processing Dependency: python2-hawkey >= 0.22.5 for package: python2-dnf-4.0.9.2-2.el7_9.noarch
--> Processing Dependency: libmodulemd >= 1.4.0 for package: python2-dnf-4.0.9.2-2.el7_9.noarch
--> Processing Dependency: python2-libdnf for package: python2-dnf-4.0.9.2-2.el7_9.noarch
--> Processing Dependency: python-enum34 for package: python2-dnf-4.0.9.2-2.el7_9.noarch
--> Running transaction check
---> Package dnf-data.noarch 0:4.0.9.2-2.el7_9 will be installed
---> Package libmodulemd.x86_64 0:1.6.3-1.el7 will be installed
---> Package python-enum34.noarch 0:1.0.4-1.el7 will be installed
---> Package python2-hawkey.x86_64 0:0.22.5-2.el7_9 will be installed
--> Processing Dependency: libdnf(x86-64) = 0.22.5-2.el7_9 for package: python2-hawkey-0.22.5-2.el7_9.x86_64
--> Processing Dependency: libsolvext.so.0(SOLV_1.0)(64bit) for package: python2-hawkey-0.22.5-2.el7_9.x86_64
--> Processing Dependency: libsolv.so.0(SOLV_1.0)(64bit) for package: python2-hawkey-0.22.5-2.el7_9.x86_64
--> Processing Dependency: libsolvext.so.0()(64bit) for package: python2-hawkey-0.22.5-2.el7_9.x86_64
--> Processing Dependency: libsolv.so.0()(64bit) for package: python2-hawkey-0.22.5-2.el7_9.x86_64
--> Processing Dependency: librhsm.so.0()(64bit) for package: python2-hawkey-0.22.5-2.el7_9.x86_64
--> Processing Dependency: librepo.so.0()(64bit) for package: python2-hawkey-0.22.5-2.el7_9.x86_64
--> Processing Dependency: libdnf.so.2()(64bit) for package: python2-hawkey-0.22.5-2.el7_9.x86_64
---> Package python2-libcomps.x86_64 0:0.1.8-14.el7 will be installed
--> Processing Dependency: libcomps(x86-64) = 0.1.8-14.el7 for package: python2-libcomps-0.1.8-14.el7.x86_64
--> Processing Dependency: libcomps.so.0.1.6()(64bit) for package: python2-libcomps-0.1.8-14.el7.x86_64
---> Package python2-libdnf.x86_64 0:0.22.5-2.el7_9 will be installed
--> Running transaction check
---> Package libcomps.x86_64 0:0.1.8-14.el7 will be installed
---> Package libdnf.x86_64 0:0.22.5-2.el7_9 will be installed
---> Package librepo.x86_64 0:1.8.1-8.el7_9 will be installed
---> Package librhsm.x86_64 0:0.0.3-3.el7_9 will be installed
---> Package libsolv.x86_64 0:0.6.34-4.el7 will be installed
--> Finished Dependency Resolution
(1/17): dnf-data-4.0.9.2-2.el7_9.noarch.rpm | 51 kB 00:00:00
(2/17): dnf-4.0.9.2-2.el7_9.noarch.rpm | 357 kB 00:00:00
(3/17): leapp-0.17.0-1.el7_9.noarch.rpm | 29 kB 00:00:00
(4/17): leapp-deps-0.17.0-1.el7_9.noarch.rpm | 12 kB 00:00:00
(5/17): leapp-upgrade-el7toel8-deps-0.20.0-2.el7_9.noarch.rpm | 35 kB 00:00:00
(6/17): libcomps-0.1.8-14.el7.x86_64.rpm | 75 kB 00:00:00
(7/17): leapp-upgrade-el7toel8-0.20.0-2.el7_9.noarch.rpm | 1.2 MB 00:00:00
(8/17): libdnf-0.22.5-2.el7_9.x86_64.rpm | 536 kB 00:00:00
(9/17): libmodulemd-1.6.3-1.el7.x86_64.rpm | 153 kB 00:00:00
(10/17): librhsm-0.0.3-3.el7_9.x86_64.rpm | 28 kB 00:00:00
(11/17): python2-hawkey-0.22.5-2.el7_9.x86_64.rpm | 71 kB 00:00:00
(12/17): python2-leapp-0.17.0-1.el7_9.noarch.rpm | 178 kB 00:00:00
(13/17): python2-libcomps-0.1.8-14.el7.x86_64.rpm | 47 kB 00:00:00
(14/17): librepo-1.8.1-8.el7_9.x86_64.rpm | 82 kB 00:00:00
(15/17): python2-libdnf-0.22.5-2.el7_9.x86_64.rpm | 611 kB 00:00:00
(16/17): libsolv-0.6.34-4.el7.x86_64.rpm | 329 kB 00:00:00
(17/17): python2-dnf-4.0.9.2-2.el7_9.noarch.rpm | 414 kB 00:00:00
[root@ngelinux ~]#

 

Thats it.

Now you can see the packages in your current directory.

0 0 votes
Article Rating
Subscribe
Notify of
guest

0 Comments
Newest
Oldest Most Voted
Inline Feedbacks
View all comments