So I have a single machine on which I have installed CentOS Minimal and nothing more. It is completely isolated. This means the following:
- It can never be connected to another server or laptop
- The ONLY thing I can connect to it is a USB-disk.
My goal:
- Run
yum install docker
on it so it can run containers.
So I googled around on how to download a batch of RPMs and their dependencies, and then install them on an offline system.
So I did this on my macOS laptop:
$ docker run -v $PWD/pkg:/pkg centos:7
# mkdir /tmp/empty
# yum install -y \
--installroot /tmp/empty \
--releasever 7 \
--downloadonly \
--downloaddir /pkg \
docker
Now I have lots of RPM files inside a folder. I put that folder on a USB stick and stick it into my isolated CentOS machine. Then I run:
$ yum install /tmp/pkg/*
...
Error: Package: rpm-python-4.11.3-32.el7.x86_64 (installed)
Requires: rpm = 4.11.3-32.el7
Removing: rpm-4.11.3-32.el7.x86_64 (installed)
rpm = 4.11.3-32.el7
Updated By: rpm-4.11.3-35.el7.x86_64 (/rpm-4.11.3-35.el7.x86_64)
rpm = 4.11.3-35.el7
I have also tried to make the folder into a repository by running createrepo
inside it on my Mac via docker (since I do not have createrepo
on the isolated machine and cannot install anything on it). But it gives me the exact same error.
So what are my options here? It looks to me that because of dependency hell I have to actually mirror the whole CentOS repository. If I wanted a package from EPEL I would have to mirror that one as well. That's lots of gigabytes to transfer and store just to install docker on an isolated machine.
Is there any viable solution to this?
Bonus question: What if I run RHEL on the isolated machine instead of CentOS?