Set up yum repository for locally-mounted DVD on Red Hat Enterprise Linux 7

 Mount the RHEL 7 installation ISO to a directory like /mnt, e.g.:
  1. # mount -o loop RHEL7.1.iso /mnt
    

    If you use DVD media , you can mount like below.

    # mount -o loop /dev/sr0  /mnt
    
  2. Copy the media.repo file from the root of the mounted directory to /etc/yum.repos.d/ and set the permissions to something sane, e.g.:
    # cp /mnt/media.repo /etc/yum.repos.d/rhel7dvd.repo
    # chmod 644 /etc/yum.repos.d/rhel7dvd.repo
    
  3. Edit the new repo file, changing the gpgcheck=0 setting to 1 and adding the following 3 lines
    enabled=1
    baseurl=file:///mnt/
    gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-redhat-release
    

    In the end, the new repo file could look like the following (though the mediaid will be different depending on the version of RHEL):

    [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/
    gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-redhat-release
    
  4. clear the related caches by yum clean all and subscription-manager clean once
    # yum clean all
    # subscription-manager clean
    
  5. check whether you can get the packages list from the DVD repo
    # yum  --noplugins list
    
  6. if no problem , you wil update
    # yum  --noplugins update
Categories: Redhat

1 Comment

bolton computer repair · 03/09/2020 at 00:16

Keep up the good piece of work, I read few content
on this website and I conceive that your site is really interesting and has got sets of
great info.

Leave a Reply

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

fourteen − 13 =

Related Posts

Redhat

How to change / set hostname Centos / RHEL 7

How to change / set hostname Centos / RHEL 7 Hostname types We can configure 3 hostname types is CentOS/RHEL 7 : Hostname Type Description Static Assigned by the system admin Dynamic Assigned by DHCP Read more…

CentOs

Linux Test Disk I/O Performance

How can I use dd command on a Linux to test I/O performance of my hard disk drive? How do I check the performance of a hard drive including the read and write speed on Read more…

CentOs

Membuat Lokal Repository RHEL/ CentOS.

Red Hat Enterprise 5/6 mempunyai cara yang berbeda dalam pembuatan repository / installation directory dibandingkan Red Hat Enterprise 4. Sebenarnya menggunakan NFS, FTP maupun HTTP repository bisa dilakukan di RHEL5, tapi db info yang digunakan Read more…