Requirements
This method works best with a connected computer with same OS and Version.
This enables one to ascertain the dependent packages that need to be downloaded by the Package Manager for the disconnected (air-gapped) computer.
sudo will only be used when necessary.
Centos 7 Example
On Redhat and Centos OS, tar and libnsl may need to be pre-installed as they are needed to unpack the installer runfile.
On the disconnected (air-gapped) computer we will firstly determine which pre-installation required packages need to be downloaded:
# Navigate to a clean directory to download packages to
mkdir -p /tmp/omk_opXyz_packages
cd /tmp/omk_opXyz_packages/
# Extract the list of dependent packages - I've used sort and formatted the results
# to make the needed comparison to those packages already installed easier:
# to see the unsorted results run command yum -q deplist tar
yum -q deplist tar|grep -e "package:" -e "provider:"|sed -r -e 's/^\s*(package|provider):\s+(.+?)$/\2/' -e 's/ /\t\t\t\t/'|sort|uniqbash.x86_64 4.2.46-34.el7
glibc.i686 2.17-307.el7.1glibc.x86_64 2.17-307.el7.1info.x86_64 5.1-5.el7libacl.x86_64 2.2.51-15.el7libselinux.x86_64 2.5-15.el7tar.x86_64 2:1.26-35.el7
# libnsl is not needed in this example as no package is returned:
yum -q deplist libnsl# Now we grep from the list yum returns of installed packages THAT WE ALREADY HAVE on this disconnected (air-gapped) computer
yum list installed|grep -e "^bash.x86_64" -e "^glibc.i686" -e "^glibc.x86_64" -e "^info.x86_64" -e "^libacl.x86_64" -e "^libselinux.x86_64" -e "^tar.x86_64"|sortbash.x86_64 4.2.46-34.el7 @anaconda
glibc.x86_64 2.17-307.el7.1 @anaconda
info.x86_64 5.1-5.el7 @anaconda
libacl.x86_64 2.2.51-15.el7 @anaconda
libselinux.x86_64 2.5-15.el7 @anaconda
tar.x86_64 2:1.26-35.el7 @anaconda
# I have then crossed out the packages this disconnected (air-gapped) computer already has up to date versions of, which leaves us with the following packages needed:glibc.i686 2.17-307.el7.1
Using the connected computer with same OS and Version we will now fetch the pre-installation required packages:
# Download each of the dependent packages:
yumdownloader glibc.i686Loaded plugins: fastestmirror
Loading mirror speeds from cached hostfile
epel/x86_64/metalink | 4.4 kB 00:00:00
* base: mirror.nsw.coloau.com.au
* epel: fedora.melbourneitmirror.net
* extras: mirror.nsw.coloau.com.au
* updates: mirror.nsw.coloau.com.au
base | 3.6 kB 00:00:00
extras | 2.9 kB 00:00:00
updates | 2.9 kB 00:00:00
glibc-2.17-307.el7.1.i686.rpm# Downloaded packages will now be in the current directory and ready for transferring to the disconnected (air-gapped) computer where they will be installed:
ls -la-rw-rw-r--. 1 user user 4463036 Apr 3 21:12 glibc-2.17-307.el7.1.i686.rpm
On the disconnected (air-gapped) computer we will now install the downloaded required packages
# Install each of the downloaded required packages:
sudo yum install glibc-2.17-307.el7.1.i686.rpm