Notes for later, how to install packages (and their deps!) on a server without access to internet? Definitely the 'quick way to do it' not the 'right one'.
$ docker run --rm -it centos:7.6.1810 /bin/bash
# cd
# yumdownloader --resolve nmap-ncat ... # download all required packages and their dependencies
# yum install -y createrepo
# createrepo $PWD
# tar cf repo.tar *
Copy repo.tar
to your machine:
$ docker ps
CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES
ca6832d91da4 centos:7.6.1810 "/bin/bash" 43 minutes ago Up 43 minutes xenodochial_nobel
$ docker cp xenodochial_nobel:/root/repo.tar .
Move repo.tar
however you can to your server (through jump host, USB, etc).
On target server, as root
:
# cd
# tar xf repo.tar
# vim /etc/yum.repos.d/localrepo.repo
Add something like this to localrepoo.repo
:
[localrepo]
name=local repo
baseurl=file:///root
enabled=1
And then you can go ahead and install packages with a normal yum install -y nmap-nat
.