Local YUM repository configuration in RedHat-Linux

A simple way to create Yum repository in Linux.

Create a directory under /mnt.

e.g. mkdir /mnt/rhel-7

By using created directory, mount the DVD or Iso Image.

e.g. mount /dev/cdrom /mnt/rhel-7

Go to the inside the yum.repo.d/

cd /etc/yum.repo.d/

create a new file by using vi or vim editor.

vim DVD.repo

[dvd]
name=rhel-7
baseurl=file:///mnt/rhel-7
gpgcheck=0
enalbed=1

(save and quit by using the :wq!).

Note:- this is temporary mount only if you want it permanent you should make an entry in  /etc/fstab.


/dev/sr0      /mnt/rhel-7  iso9660   defaults   0 0

(save and quit by using the :wq!).

yum clean all

yum repolist all


Note:-


gpgcheck=value
                -->     0 : Disable. GPG signature-checking on packages in the repository
                -->     1 : Enable. Enables GPG signature-checking on all packages in the repository

gpgcheck=1 is the default value, GPG signatures will be checked automatically

Enabled=value
                 -->     0 : Disable .the repository and does not search for packages in this repository when installing or performing updates using YUM. A repository can be turned on and off by setting the enable value.


                 -->     1 : Enable .the repository as a package source to look for packages and its information when installing or performing updates using YUM.


Tip: Create an ISO image from an source CD or DVD.
         dd if=/dev/cdrom of=rhel7.iso