You can mount the OS installation media DVD (iso) and configure and use it as a yum repository. yum repository is a collection of RPMs in a single location.

To create a local yum repository (for example, if a system does not have Internet access):

  1. Download a full Linux DVD image and copy to removable storage (such as a USB memory stick) or burn it to a Disk
  2. Transfer the removable storage to the system on which you want to create a local yum repository, and copy the DVD image to a directory in a local file system.
    • Login to root user create a directory mkdir -p /mnt/disc
    • Mount rhel Disk mount -o loop RHEL7.1.iso /mnt/disc < or > mount oracle disk mount -o loop,ro V33411-01.iso /mnt/disc
  3. YUM Configure,
    • Disable all existing yum repositories.
      • yum-config-manager –disable *
    • For Redhat
      • cp /mnt/disc/media.repo /etc/yum.repos.d/rhel7dvd.repo
      • chmod 644 /etc/yum.repos.d/rhel7dvd.repo
      • vi /etc/yum.repos.d/rhel7dvd.repo
        • enabled=1
        • baseurl=file:///mnt/disc/
        • gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-redhat-release

In the end, the new repo file could look like the following
[InstallMedia]
name=DVD for Red Hat Enterprise Linux 7.1 Server
mediaid=1359576196.686790
metadata_expire=-1
gpgcheck=1
cost=500
enabled=1
baseurl=file:///mnt/disc/
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-redhat-release

yum clean all
yum repolist enabled
yum update

Test Yum by executing Yum install command

Yum install postfix cyrus-sasl-plain

By mithun

Leave a Reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.