I have a custom rpm given to me by a vendor that has dependencies that are pulled when installed. I need to install this package on a closed network system, so I cannot access the internet to gather the dependencies. I can however access a intermediate server that can access the internet but will not allow traffic from the closed network though.

Is it possible to create a local network repository the closed network can access to install this package? I have already created a repo in my local directory using:

createrepo .

I have also tried to get a list of the dependencies using:

rpm -qpR *package*

How would I go about pulling the rpms or other installation data from the dependencies list into the local repo?


yum install yum-utils to get some useful package management utilities. repotrack package will download all dependencies. Put this in a directory and run createrepo /srv/my/repo This is a repository you can add to the closed system's /etc/yum.repos.d/ with a file URI:

   name = This is my repo
   baseurl = file:///srv/my/repo/

You also need a system for updates anyway. Download updates on an Internet connected system and put them in a repo in the same way. (Updates could be sourced with a management product like Satellite but do not have to be.)

yumdownloader vs repotrack


| improve this answer | |

I had the same requirement but I wasn't able to get 100% of the info I needed to do this from these answers. I hope this is helpful to someone.

These commands must be run on the source machine, which has an internet connection.

yum install -y createrepo

# Add a local temporary directory
mkdir packages

# Download whatever packages you need to the temporary directory
yum install --downloadonly --downloaddir=packages perl

# Now, create the repository. If you need to add more packages, be sure to execute this
# command again before you bundle it up
createrepo packages

# Compress the packages directory:
tar -zcf packages.tgz packages

Now, transfer this to your destination machine, which does not have an internet connection and decompress the archive:

tar -zxf packages.tgz -C /opt/

Create /etc/yum.repos.d/local.repo and add these contents:

name=Local Repository

If you're updating the packages bundle, you will need to clean the cache first, or your new packages won't be found:

yum clean all

You can now install your desired package without an internet connection:

yum --disablerepo='*' --enablerepo=local install perl

The gpgcheck parameter is quite important, it means that you check that the packages weren't changed since leaving your source machine as they're signed by Red Hat's key. This is generally good enough for most infosec teams.

| improve this answer | |

You'll need to configure yum to access your local repo. See https://wiki.centos.org/HowTos/CreateLocalRepos

| improve this answer | |
  • 1
    Whilst this may theoretically answer the question, it would be preferable to include the essential parts of the answer here, and provide the link for reference. – Gerald Schneider Jul 31 '17 at 18:17

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.