1

I want to install some packages (.rpm files) on a RedHat system with no internet access. So, I'd have to download the packages on another system and copy them to the target system. But I do not have another RedHat system; all I have is my MacBook. And, to make matters worse, the internet access I have on my MacBook is from tethering my phone's 3G internet connection, where my network provider caps the tethered internet speed to 384 kBps. So, I cannot download a RedHat ISO of 1.5 GB to install as a virtual machine, as it would take hours. So, it'd be much more productive to be able to download the required RPM files on my Mac, as they typically are some kB in size, and I can't see the total size of all the required RPM dependency files exceeding, say, 100 MB.

So, how do I do the Mac equivalent of the Fedora-based-Linux code below:

sudo yum install \
  --installroot=</path/to/tmp_dir> \
  --downloadonly --downloaddir <rpm_dir> <package>

in order to download all the requisite RPM packages along with their dependencies in a Mac?

  • 1
    Is that really RH(EL) or CentOS/Scientific Linux/Fedora? Because if you want genuine RHEL packages from RH, your Mac will probably need to provide licensing information as well… – Ulrich Schwarz Dec 28 '17 at 13:20
0

The easiest way would be to install Docker and pull a basic fedora image (~250MB uncompressed)) then use either yum deplist or repoquery to get the list of dependencies and yumdownloader to get the URLs.

You could also modify /etc/yum.conf by setting keepcache=1, install the packages from within the container and get the saved RPMs, but this would probably download also packages you already have installed on the other system as the fedora docker image is very small.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.