LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Newbie (https://www.linuxquestions.org/questions/linux-newbie-8/)
-   -   How to find and download all the dependencies of a package? (https://www.linuxquestions.org/questions/linux-newbie-8/how-to-find-and-download-all-the-dependencies-of-a-package-4175640027/)

sparkling 10-09-2018 10:10 AM

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


jsbjsb001 10-09-2018 10:15 AM

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.

AwesomeMachine 10-09-2018 03:39 PM

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.

RockDoctor 10-09-2018 03:56 PM

Quote:

Originally Posted by AwesomeMachine (Post 5912943)
...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 *

AwesomeMachine 10-09-2018 03:59 PM

I don't think that will work unless you do it with 'rpm'.
Code:

$ rpm -uvH *.rpm

jsbjsb001 10-09-2018 09:27 PM

Quote:

Originally Posted by AwesomeMachine (Post 5912947)
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.

sparkling 10-10-2018 08:15 AM

Quote:

Originally Posted by AwesomeMachine (Post 5912943)
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

sparkling 10-10-2018 08:17 AM

Quote:

Originally Posted by RockDoctor (Post 5912946)
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

jsbjsb001 10-10-2018 08:36 AM

Quote:

Originally Posted by sparkling (Post 5913176)
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 (Post 5913177)
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.

lazydog 10-10-2018 11:39 AM

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.

Habitual 10-10-2018 11:59 AM

Quote:

Originally Posted by sparkling (Post 5912815)
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!

lazydog 10-10-2018 02:10 PM

Quote:

Originally Posted by Habitual (Post 5913291)

These are all great links, you just missed to part where the system doesn't have access to the internet.

ondoho 10-11-2018 12:55 AM

Quote:

Originally Posted by lazydog (Post 5913350)
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!

jsbjsb001 10-11-2018 01:21 AM

Quote:

Originally Posted by ondoho (Post 5913472)
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.

Habitual 10-11-2018 09:31 AM

https://stackoverflow.com/questions/...pendency-issue

Have fun.


All times are GMT -5. The time now is 08:38 AM.