LinuxQuestions.org
Review your favorite Linux distribution.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!

Notices


Reply
  Search this Thread
Old 10-09-2018, 11:10 AM   #1
sparkling
LQ Newbie
 
Registered: Apr 2017
Posts: 20

Rep: Reputation: Disabled
How to find and download all the dependencies of a package?


Hi all,

I am trying to find a way to install docker-ce on a CentOS box with no internet connection (government box). I have gone down the dependency hole years ago while trying to install another package so this time I am trying to cover all my bases.

I found several commands which can show or download all the dependencies for each given package and I will list them below. But the result of each command is not the same as the other ones. There are some common packages, but not all the same. I was just wondering if someone could please help me figure out a way to download all the dependencies so I can burn them on a DVD and take it to the remote location and install Docker successfully. Thank you

Code:
repoquery --requires --resolve docker-ce
yum deplist docker-ce
yum install --downloadonly --downloaddir=/home/test docker
 
Old 10-09-2018, 11:15 AM   #2
jsbjsb001
Senior Member
 
Registered: Mar 2009
Location: Earth? I would say I hope so but I'm not so sure about that... I could just be a figment of your imagination too.
Distribution: Currently OpenMandriva. Previously openSUSE, PCLinuxOS, CentOS, among others over the years.
Posts: 3,412

Rep: Reputation: 1762Reputation: 1762Reputation: 1762Reputation: 1762Reputation: 1762Reputation: 1762Reputation: 1762Reputation: 1762Reputation: 1762Reputation: 1762Reputation: 1762
I think what you're asking would mean you setup your own local yum repo.

Have a look at this. Some very good research there BTW, well done.
 
Old 10-09-2018, 04:39 PM   #3
AwesomeMachine
LQ Guru
 
Registered: Jan 2005
Location: USA and Italy
Distribution: Debian testing/sid; OpenSuSE; Fedora; Mint
Posts: 5,511

Rep: Reputation: 1006Reputation: 1006Reputation: 1006Reputation: 1006Reputation: 1006Reputation: 1006Reputation: 1006Reputation: 1006
I don't think there is a way to download a package file and automatically download the dependencies. But you can download the package file, list the dependencies, and download each dependency. Then, the only problem is, what order to install them in.
 
Old 10-09-2018, 04:56 PM   #4
RockDoctor
Senior Member
 
Registered: Nov 2003
Location: Minnesota, US
Distribution: Fedora, Ubuntu, Linux Mint
Posts: 1,714

Rep: Reputation: 400Reputation: 400Reputation: 400Reputation: 400Reputation: 400
Quote:
Originally Posted by AwesomeMachine View Post
...download each dependency. Then, the only problem is, what order to install them in.
What I'll do (with Fedora, but it shouldbe the same with CentOS) is download all of the needed rpms into an initially empty directory, open a terminal in that directory, and do a
Code:
sudo dnf install *
or
Code:
sudo yum localinstall *
 
Old 10-09-2018, 04:59 PM   #5
AwesomeMachine
LQ Guru
 
Registered: Jan 2005
Location: USA and Italy
Distribution: Debian testing/sid; OpenSuSE; Fedora; Mint
Posts: 5,511

Rep: Reputation: 1006Reputation: 1006Reputation: 1006Reputation: 1006Reputation: 1006Reputation: 1006Reputation: 1006Reputation: 1006
I don't think that will work unless you do it with 'rpm'.
Code:
$ rpm -uvH *.rpm
 
Old 10-09-2018, 10:27 PM   #6
jsbjsb001
Senior Member
 
Registered: Mar 2009
Location: Earth? I would say I hope so but I'm not so sure about that... I could just be a figment of your imagination too.
Distribution: Currently OpenMandriva. Previously openSUSE, PCLinuxOS, CentOS, among others over the years.
Posts: 3,412

Rep: Reputation: 1762Reputation: 1762Reputation: 1762Reputation: 1762Reputation: 1762Reputation: 1762Reputation: 1762Reputation: 1762Reputation: 1762Reputation: 1762Reputation: 1762
Quote:
Originally Posted by AwesomeMachine View Post
I don't think that will work unless you do it with 'rpm'.
Code:
$ rpm -uvH *.rpm
yum supports wildcards. So that would work.

But, it maybe the following that would be better;

Code:
yum install <string_here>*
Replace <string_here> with the first letter(s) of the package names in question.

There's no need to use "sudo" as by default, it's not configured in CentOS, as you would switch to the "root" user instead.

Last edited by jsbjsb001; 10-09-2018 at 10:33 PM. Reason: addition
 
Old 10-10-2018, 09:15 AM   #7
sparkling
LQ Newbie
 
Registered: Apr 2017
Posts: 20

Original Poster
Rep: Reputation: Disabled
Quote:
Originally Posted by AwesomeMachine View Post
I don't think there is a way to download a package file and automatically download the dependencies. But you can download the package file, list the dependencies, and download each dependency. Then, the only problem is, what order to install them in.
Thanks, this will work, too. Can you please let me know how to find the dependencies for a given package? I.e. docker-ce

Thank you
 
Old 10-10-2018, 09:17 AM   #8
sparkling
LQ Newbie
 
Registered: Apr 2017
Posts: 20

Original Poster
Rep: Reputation: Disabled
Quote:
Originally Posted by RockDoctor View Post
What I'll do (with Fedora, but it shouldbe the same with CentOS) is download all of the needed rpms into an initially empty directory, open a terminal in that directory, and do a
Code:
sudo dnf install *
or
Code:
sudo yum localinstall *
Thank you, how will I know which rpms are required? I would like to find a way to find those rpms, download them and burn them into a DVD and take them to the customer site.

Thank you
 
Old 10-10-2018, 09:36 AM   #9
jsbjsb001
Senior Member
 
Registered: Mar 2009
Location: Earth? I would say I hope so but I'm not so sure about that... I could just be a figment of your imagination too.
Distribution: Currently OpenMandriva. Previously openSUSE, PCLinuxOS, CentOS, among others over the years.
Posts: 3,412

Rep: Reputation: 1762Reputation: 1762Reputation: 1762Reputation: 1762Reputation: 1762Reputation: 1762Reputation: 1762Reputation: 1762Reputation: 1762Reputation: 1762Reputation: 1762
Quote:
Originally Posted by sparkling View Post
Thanks, this will work, too. Can you please let me know how to find the dependencies for a given package? I.e. docker-ce

Thank you
The same command (yum deplist <package_name>) you already posted in post #1.

Quote:
Originally Posted by sparkling View Post
Thank you, how will I know which rpms are required? I would like to find a way to find those rpms, download them and burn them into a DVD and take them to the customer site.

Thank you
The same command as mentioned above. From the CentOS repo's.

Did you read my post #6 ? And your very welcome too.

Last edited by jsbjsb001; 10-10-2018 at 09:38 AM. Reason: corrected post number.
 
Old 10-10-2018, 12:39 PM   #10
lazydog
Senior Member
 
Registered: Dec 2003
Location: The Key Stone State
Distribution: CentOS Sabayon and now Gentoo
Posts: 1,242
Blog Entries: 3

Rep: Reputation: 194Reputation: 194
Code:
yum install --downloadonly --downloaddir=/tmp/test docker
This should download all the programs that are required for the machine you run this code on. The only issue I see is if the machine you are then going to install doesn't have all the other packages that are also required you are going to have to download them also.

Here what you are going to have to do. Get yourself the Deplist readout on the system with internet access. Go to the target system where you want to install Docker and see what packages are missing from that list. With that list you then return to the system that has internet access and run the above command. Once all the packages are downloaded compare them to the list you got from the target machine. Download any missing packages and you should be good to go then. Copy all packages over to the target machine and run the yum install local command to install everything.

Just remember to vet your packages before install.
 
Old 10-10-2018, 12:59 PM   #11
Habitual
LQ Veteran
 
Registered: Jan 2011
Location: Yawnstown, Ohio
Distribution: Mojave
Posts: 9,374
Blog Entries: 37

Rep: Reputation: Disabled
Quote:
Originally Posted by sparkling View Post
I have gone down the dependency hole years ago while trying to install another package so this time I am trying to cover all my bases.
All your bases are belong to us.
How To Install and Use Docker on CentOS 7
Get Docker CE for CentOS
https://hub.docker.com/_/centos/
How to install and setup Docker on RHEL 7/CentOS 7

Have fun running those bases!
 
Old 10-10-2018, 03:10 PM   #12
lazydog
Senior Member
 
Registered: Dec 2003
Location: The Key Stone State
Distribution: CentOS Sabayon and now Gentoo
Posts: 1,242
Blog Entries: 3

Rep: Reputation: 194Reputation: 194
Quote:
Originally Posted by Habitual View Post
These are all great links, you just missed to part where the system doesn't have access to the internet.
 
Old 10-11-2018, 01:55 AM   #13
ondoho
LQ Addict
 
Registered: Dec 2013
Posts: 13,132
Blog Entries: 9

Rep: Reputation: 3599Reputation: 3599Reputation: 3599Reputation: 3599Reputation: 3599Reputation: 3599Reputation: 3599Reputation: 3599Reputation: 3599Reputation: 3599Reputation: 3599
Quote:
Originally Posted by lazydog View Post
These are all great links, you just missed to part where the system doesn't have access to the internet.
i wonder how they're posting to LQ then.

wait, i know! the same way you do: with a windows machine!
 
Old 10-11-2018, 02:21 AM   #14
jsbjsb001
Senior Member
 
Registered: Mar 2009
Location: Earth? I would say I hope so but I'm not so sure about that... I could just be a figment of your imagination too.
Distribution: Currently OpenMandriva. Previously openSUSE, PCLinuxOS, CentOS, among others over the years.
Posts: 3,412

Rep: Reputation: 1762Reputation: 1762Reputation: 1762Reputation: 1762Reputation: 1762Reputation: 1762Reputation: 1762Reputation: 1762Reputation: 1762Reputation: 1762Reputation: 1762
Quote:
Originally Posted by ondoho View Post
i wonder how they're posting to LQ then.

wait, i know! the same way you do: with a windows machine!
The OP is talking about downloading packages on one machine and then installing those same packages on a different machine.
 
Old 10-11-2018, 10:31 AM   #15
Habitual
LQ Veteran
 
Registered: Jan 2011
Location: Yawnstown, Ohio
Distribution: Mojave
Posts: 9,374
Blog Entries: 37

Rep: Reputation: Disabled
https://stackoverflow.com/questions/...pendency-issue

Have fun.

Last edited by Habitual; 10-11-2018 at 10:37 AM.
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
[SOLVED] Download rpm package with dependencies smilemukul Linux - Newbie 3 10-11-2012 12:56 AM
[SOLVED] how can I download and install a debian package with all dependencies gujedan Linux - Newbie 7 03-05-2011 06:26 PM
Need a command to find the package name against dependencies ! shipon_97 Linux - Newbie 4 01-17-2010 06:33 PM
Dependencies Download??? venkat3271 Linux - Newbie 4 02-07-2008 03:36 PM
Download dpkg and dependencies of a package FROM a non linux PC mfrangos79 Linux - Software 4 11-06-2006 04:47 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie

All times are GMT -5. The time now is 09:39 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration