Setup YUM Repository on RHEL 8 using DVD

 Setup-YUM-Repository-on-RHEL-8-using-DVD

This guide will help you to set up a local yum repository to use locally-mounted DVD with Red Hat Enterprise Linux (RHEL) 8. This local repository lets you save internet bandwidth as well as the time for downloading packages from the internet. Since the packages are downloaded via a local network, the updates will happen at a lightning speed. YUM is a widely used software package management utility for RPM (RedHat Package Manager) based Linux systems, which makes software installation easy on Red Hat.

Repositories are generally stored on a public network, which can be accessed by multiple users on the internet. Red Hat Enterprise Linux 8 is split across two repositories,

  • BaseOS
  • Application Stream (AppStream)
  1. BaseOS – It provides the parts of the distribution that give you a running userspace on physical hardware, a virtual machine, a cloud instance or a container.
  2. AppStream – It provides all the applications you might want to run in a given userspace.

Let’s start : You need to mount the DVD ROM on any directory of your wish. For testing, we will mount it on /soft.

Create a .repo file

Before creating a <name>.repo file, move the existing files present in
/etc/yum.repos.d/directory to/tmp, if no longer required.

mv /etc/yum.repos.d/*.repo /tmp/ 

Create a repo file called local.repo under /etc/yum.repos.d directory.

vi /etc/yum.repos.d/local.repo 
Base OS
[LocalRepo_BaseOS]
name=LocalRepository_BaseOS
baseurl=file:///soft/BaseOS
enabled=1
gpgcheck=1
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-redhat-release
 App Stream                                                                                                                       [LocalRepo_AppStream]
name=LocalRepository_AppStream
baseurl=file:///soft/AppStream
enabled=1
gpgcheck=1
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-redhat-release

Note : [LocalRepo] – Name of the Section
name – Name of the repository
baseurl – Location of the package
Enabled – Enable repository
gpgcheck – Enable secure installation (gpgcheck is optional (If you set gpgcheck=0, there is no need to mention gpgkey)
gpgkey – Location of the key

There you go, you have successfully configured the local yum repository. If you need any assistance Contact Us.

If this guide was helpful share it with your friends, as this may help someone who is looking for how to create one in RHEL 8.

Subscribe to get free blog content to your Inbox


Join us on Facebook , Twitter for updates