e Learning

How to Configure Red Hat 7 DVD as redhat yum repository

In this Red Hat 7 tutorial we are going to learn how to configure RHEL 7 DVD as Redhat yum repository(Local repository).

Red Hat Enterprise Linux 7 is a subscription base Linux Distribution. We can install and use Red hat 7 for free, but we cannot use their software repositories to to install software without a Redhat subscription.

So in order to install softwares using yum command we need to configure Our RHEL 7 DVD as a yum repository.

It is very easy. First, we need to mount the red hat 7 DVD, then create the local repository file.

Create the Mount Point

First, we need to create a folder to mount the RHEL 7 DVD.

mkdir /rhel7DVD/

Mount the DVD

Next, insert the red hat 7 DVD to the CDROM and mount using the mount command as follows.

mount /dev/cdrom /rhel7DVD/

Create The Local Repository File

Now create the .repo configuration file inside the /etc/yum.repos.d/ directory.

touch /etc/yum.repos.d/rhel7dvd.repo

Then add the following lines and save the file.

[DVD]

name=RHEL 7 Local Repository

baseurl=file:///rhel7DVD

enabled=1

gpgcheck=0

You can run yum repolist command to make sure that local redhat yum repository is active.

yum repolist

Configure Red Hat 7 DVD as redhat yum repository

And we are done. Now you can install base Red hat softwares from the local repository using yum command.

What we Learned?

In this tutorial we learned how to configure a Redhat yum repository on Red hat 7 using RHEL 7 DVD.

First, we mounted the DVD using mount command and created the redhat yum repository inside the /etc/yum.repos.d/ folder.