Our server runs offline and we need to install lot of yum packages, like oracle-jdk, elasticsearch, nginx, etc.
Is there any way to download the rpm dependencies so we can install them offline in the server?
Our server runs offline and we need to install lot of yum packages, like oracle-jdk, elasticsearch, nginx, etc.
Is there any way to download the rpm dependencies so we can install them offline in the server?
Maintain a local CentOS mirror on an Internet-connected machine with
rsync
to a public CentOS mirror that accepts rsync connections. You can then copy these directories to a USB stick and use them as installation sources. They already carry the necessary metadata to act as repositories, so you only need to point the installer at them.In the case of third party packages, you can also mirror those yourself using the
reposync
command line tool, which downloads the contents of yum repositories to a local filesystem, andcreaterepo
, which creates a yum repository out of a set of RPMs in a directory.Remember that repositories do not have to be on the network. They can be located on a local filesystem such as a hard drive, DVD-ROM or USB stick.
You have to look for a local repository, take a look to this article or this one
In response to your comment:
That sounds like something fairly trivial by setting the option
keepcache=0
tokeepcache=1
inyum.conf
on the online CentOS server. First install there all packages you want to install on your offline server as well and then simply copy the collected RPM packages from the various/var/cache/yum/*/*/*packages/
directories.yum install -y xxx yyy --downloadonly
then all the rpms will be downloaded to
/var/cache/yum
.