Redhat – YUM local install dependencies

redhatyum

I have a machine that has no internet access. I am trying to install just the basic MySQL client in order to connect to a MySQL database on another machine that also has no internet access. I can download RPMs onto my personal machine, upload them to the machine with no internet access and install them like so: yum localinstall name_of_package.rpm.

Up to now that hasn't been a problem but the MySQL client appears to have a long list of dependencies. I have started installing them one by one but this process is becoming cumbersome.

Is there a way on my personal machine to download a package and all of its dependencies at the same time, upload them all to the machine with no internet access and install them with one command just like I would using yum on a machine with internet access? If not I might lose my mind. Thanks in advance!

Best Answer

You can download package and it's all dependencies with yum install. For example to download all required rpms into packages directory:

yum install --downloadonly --downloaddir=packages mysql++-devel

After all dependencies has been downloaded, you can copy the packages to the target host and install them with

yum install *