Wednesday, November 30, 2016

Step by Step Instructions to Create Yum Local Repository

This article highlights the steps to create an offline yum repository. It is quite possible that during the deployment of many enterprise solutions, the Linux OS platform i.e. RHEL (Redhat Enterprise Linux) is not registered with Redhat (Although Enterprises can’t just run their servers on unregistered version but registration will take some time).

So if RHEL is not registered it means you can’t resolve rpm dependencies using online repos. Luckily, there is an option to create a yum local repository provided the packages from the existing RHEL system. Follow the steps below to create an offline yum repository.

  • Locate the rpm packages folder from an existing RHEL system.
  • Create a folder RPMS under /mnt.
  • Move all packages to the location /mnt/RPMS.
  • Manually install below mentioned packages with the command rpmivh <rpm package name> in the order as shown below (createrepo packge has two dependencies deltarpm and python-deltarpm).
    • deltarpm-3.5-0.5.20090913git.el6.x86_64.rpm
    • python-deltarpm-3.5-0.5.20090913git.el6.x86_64.rpm
    • createrepo-0.9.9-17.el6.noarch.rpm
  • Create a file local.repo inside /etc/yum.repo.d with the following parameters:


  • Enter below mentioned commands to refresh the yum cache.
    • Yum clean all
    • Yum repolist (you will see local repo in the list of repositories).

Now you have configured the yum local repository. Enter yum install command to resolve dependencies automatically.




No comments:

Post a Comment