So I [almost] know how to update an offline rhel/centos 7 system, I am using a second identical system which is registered with RHN and other repositories.

In /etc/yum.conf I have keep_cache = 1 and I have 1000+ rpms under /var/cache/yum/x86_64/7Server/<repo>/packages/

update: forgot to mention i also am doing /etc/yum.repos.d/local.repo having file:///root/localrepo

On the first time, if I put simply put ALL rpm's under one folder /root/localrepo/ for example then do createrepo /root/localrepo then a yum update works fine.

In the future, on my RHN connected system I get new rpm's, I move and add them to my offline system under that /root/localrepo but a yum update does not automatically see them. What is the correct usage of createrepo then to make yum update work as expected on this offline system?


You need not only to exec createrepo but also install and run web server, point it to the directory where the packages (repo) are located and add record/file in /etc/yum-repos.d which point to your web server and path of your repo.

You can also skip the web server but in this case your repo file should point to file://path instead of http://server/path

Check this article for more information about repo config files.

Here is example config file from the site above

name = Red Hat Enterprise Linux Scalable File System (for RHEL 6 Entitlement) (RPMs)
baseurl = https://cdn.redhat.com/content/dist/rhel/entitlement-6/releases/$releasever/$basearch/scalablefilesystem/os
enabled = 1
gpgcheck = 1
gpgkey = file:///etc/pki/rpm-gpg/RPM-GPG-KEY-redhat-release
sslverify = 1
sslcacert = /etc/rhsm/ca/redhat-uep.pem
sslclientkey = /etc/pki/entitlement/key.pem
sslclientcert = /etc/pki/entitlement/11300387955690106.pem
  • what do you mean by exec createrepo ? – ron May 14 at 17:47
  • I am familiar with your link of 8.4.2. Setting [repository] Options... at least i think i am. Hoping to simply drop new rpm files under my /root/localrepo and have yum update see them. So far I've been deleting /root/localrepo/repomond then doing createrepo /root/localrepo again... seems like there should be a better way? – ron May 14 at 17:51
  • @ron, as I mention you should create repo file in /etc/yum-repos.d to "inform" yum you have new/other repo which the program can use – Romeo Ninov May 14 at 18:17
  • right, i have already done that (forget to mention) with /etc/yum.repos.d/local.repo having baseurl=file:///root/localrepo – ron May 14 at 18:56
  • @ron, did you enable this new repo? yum-config-manager --enable repository... – Romeo Ninov May 14 at 19:00

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.