Need to set up yum repository for locally-mounted DVD on Red Hat Enterprise Linux 7

Solution Verified - Updated -

Environment

  • Red Hat Enterprise Linux 7

Issue

  • How to set up yum repository to use locally-mounted DVD with Red Hat Enterprise Linux (RHEL) 7
  • Would like to upgrade server from RHEL 7.x to RHEL 7.y
  • Have a secure environment that will never be connected to the internet, but still needs to be updated
  • Way to update the packages on server, with no satellite server and servers disconnected from internet
  • Offline patches for Red Hat systems
  • How do I create a local repository in RHEL 7?

Resolution

  • Once you have downloaded a DVD version of your chosen Rhel Version and copied it over to a location on your server.
  • Mount the RHEL installation ISO to a directory like /mnt/disc, e.g.:

    # mkdir -p  /mnt/disc
    # mount -o loop RHEL7.9.iso /mnt/disc
    

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

    # mkdir -p  /mnt/disc
    # mount /dev/sr0  /mnt/disc
    
  • Copy the media.repo file from the root of the mounted directory to /etc/yum.repos.d/ and set the permissions to 0644 or another similar permissions set:

    # cp /mnt/disc/media.repo /etc/yum.repos.d/rhel7dvd.repo
    # chmod 644 /etc/yum.repos.d/rhel7dvd.repo
    
  • Edit the new repo file, changing the gpgcheck=0 setting to 1 and adding the following 3 lines

    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.9 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
    
  • Clear the cache and check whether you can get the packages list from the DVD repo

    # yum clean all
    # yum repolist enabled
    
  • It should look like the following if no other repository is enabled.
    To avoid any corruption its recommend to disable any non-RedHat repositories.

    # yum repolist enabled
    Loaded plugins: product-id, search-disabled-repos, subscription-manager
    This system is not registered to Red Hat Subscription Management. You can use subscription-manager to register.
    repo id                                                                                 repo name                                                                     
    InstallMedia                                                                        Red Hat Enterprise Linux 7.9
    repolist: 5,229
    
  • If no errors are returned, the following can be used to update:

    # yum update
    

This solution is part of Red Hat’s fast-track publication program, providing a huge library of solutions that Red Hat engineers have created while supporting our customers. To give you the knowledge you need the instant it becomes available, these articles may be presented in a raw and unedited form.

86 Comments

waste documemt

Its not a waste document, it works fine .

This help too much.

How can you say it a waste document. What do you mean by waste document? On the other hand this document works very well. Please don't just pass stupid and vague comments. If you have any valid concern regarding the article, put it straight forward.

Through this comment you seem to be waste!!!

It's Work, thanks

Helped me out with installing again "subscription-manager" on a RHEL8 in a satellite only infrastructure. For me it's clearly not a waste document.

Excellent My Friend !!!

This was very useful! Thanks

That's Great! Thank you

Outstanding!..Thanks a bunch.

Got lost at step 1. Where do I get "installation .iso ?"

For RHEL 7 Server you want the "Red Hat Enterprise Linux 7.6 Binary DVD" located on the 7.6 Downloads page.

If you need a different version or variant (Such as workstation) change the drop down near the top of the page to the correct version. What you're looking for is the Binary DVD that contains the packages.

Perfect!! Works great!!

When I run yum --noplugins list, I am receiving this error: file:///mnt/repodata/repomd.xml.asc: [Errno 14] curl#37 - "Couldn't open file /mnt/repodata/repomd.xml.asc" There is a file named "repomd.xml" in that directory, but I can't rename it as that directory is mounted read-only. Any suggestions? Thanks.

That is caused by the repo_gpgcheck variable you have in /etc/yum.conf. It's telling yum to look for an additional security check which we currently do not provide in our repositories.

On RHEL client, yum update fails with error "[Errno 14] HTTPS Error 404 - Not Found", yum was unable to download "repomd.xml.asc" file.

That fixed it. Thanks!

Not followed step by step but it helped me to setup local repo as we were disconnected from the network. Thanks guys!

after creating local repo and cleaning with subscription command while updating with yum below error shown,
# yum update Loaded plugins: langpacks, product-id, search-disabled-repos, subscription-manager, versionlock This system is not registered with an entitlement server. You can use subscription-manager to register. No packages marked for update kindly suggest. reg. mak

Same issue here also.

I got the same issue

The Binary DVD only contains 1 version of the packages from the base repo (example: rhel-7-server-rpms) at the time of release. If you install a RHEL 7.6 machine, the 7.6 Binary DVD will not update this system. The only DVD that would is a higher version such as RHEL 7.7.

I’m using 7.6 So I need to have 7.7 right?

Yes. You could also register the system, or using another online system, sync the repositories you require.

How can we regularly update a disconnected system (A system without internet connection)?

I am using 7.6 and now trying to update to 7.9, downloaded 7.9 DVD and mounted as mentioned, still getting the same message-- No packages marked for update do I need to go 7.7 then 7.8 and 7.9?

This solution works to access the ISO image. When I run "yum update," towards the end of the package identification process, the following error is thrown, before terminating without updating:

. . . ---> Package redhat-release.x86_64 0:8.0-0.44.el8 will be obsoleting ---> Package redhat-release-server.x86_64 0:7.6-4.el7 will be obsoleted ---> Package redhat-rpm-config.noarch 0:9.1.0-87.el7 will be updated ---> Package redhat-rpm-config.noarch 0:116-1.el8 will be an update Error: Invalid version flag: if

TIA, Barry

Hello,

It looks like you have configured a RHEL 8 repository on a RHEL 7 server which is not a supported configuration.

`redhat-release.x86_64 0:8.0-0.44.el8 will be obsoleting ---> Package redhat-release-server.x86_64 0:7.6-4.el7`

For upgrading RHEL 7 to RHEL 8, the steps are defined here

John, This worked.

Thank you.

Hi John, The URL you gave was removed. https://access.redhat.com/documentation/en-us/red_hat_enterprise_linux/8/html-single/upgrading_to_rhel_8/index

Have you got another copy?

I need to do the same as the OP: Add a rhel8 repository onto an offline rhel7.9 repository server.

Thanks John. I just realised this is one of the URLs you sent me earlier :)

Hello, I have used this successfully on about a dozen servers, but am receiving the error:

Error downloading packages: libmount-2.23.2-59.el7.i686: [Errno 256] No more mirrors to try. libsmartcols-2.23.2-59.el7.x86_64: [Errno 256] No more mirrors to try. glib2-2.56.1-2.el7.x86_64: [Errno 256] No more mirrors to try. subscription-manager-rhsm-1.21.10-2.el7.x86_64: [Errno 256] No more mirrors to try. gobject-introspection-1.56.1-1.el7.x86_64: [Errno 256] No more mirrors to try. python-dmidecode-3.12.2-3.el7.x86_64: [Errno 256] No more mirrors to try. glib2-2.56.1-2.el7.i686: [Errno 256] No more mirrors to try. subscription-manager-rhsm-certificates-1.21.10-2.el7.x86_64: [Errno 256] No more mirrors to try. libuuid-2.23.2-59.el7.i686: [Errno 256] No more mirrors to try. python-gobject-3.22.0-1.el7_4.1.x86_64: [Errno 256] No more mirrors to try. util-linux-2.23.2-59.el7.x86_64: [Errno 256] No more mirrors to try. subscription-manager-initial-setup-addon-1.21.10-2.el7.x86_64: [Errno 256] No more mirrors to try. libblkid-2.23.2-59.el7.i686: [Errno 256] No more mirrors to try. libblkid-2.23.2-59.el7.x86_64: [Errno 256] No more mirrors to try. python-gobject-base-3.22.0-1.el7_4.1.x86_64: [Errno 256] No more mirrors to try. subscription-manager-gui-1.21.10-2.el7.x86_64: [Errno 256] No more mirrors to try. libuuid-2.23.2-59.el7.x86_64: [Errno 256] No more mirrors to try. subscription-manager-1.21.10-2.el7.x86_64: [Errno 256] No more mirrors to try. libmount-2.23.2-59.el7.x86_64: [Errno 256] No more mirrors to try. rhsm-gtk-1.21.10-2.el7.x86_64: [Errno 256] No more mirrors to try.

I have tried the process several ties with the same results.

KHK

Are you pulling content from a DVD or from the CDN? There is ongoing issues with the CDN at this time resulting in timeouts or 404 errors. You can see the status at:

https://status.redhat.com

If you are seeing these issues with a DVD, ensure no other repos are on, ensure the iso is mounted properly and clear the cache.

[root@test ~]# yum clean all Loaded plugins: langpacks, product-id, search-disabled-repos, subscription- : manager This system is not registered to Red Hat Subscription Management. You can use subscription-manager to register. Cleaning repos: InstallMedia Cleaning up everything [root@test ~]# yum repolist Loaded plugins: langpacks, product-id, search-disabled-repos, subscription- : manager This system is not registered to Red Hat Subscription Management. You can use subscription-manager to register. InstallMedia | 4.3 kB 00:00
(1/2): InstallMedia/group_gz | 148 kB 00:00
(2/2): InstallMedia/primary_db | 4.2 MB 00:00
repo id repo name status InstallMedia Red Hat Enterprise Linux 7.6 5,295 repolist: 5,295 [root@test ~]# mount|grep rhel /root/rhel-workstation-7.6-x86_64-dvd.iso on /mnt/disc type iso9660 (ro,relatime) [root@ca6test ~]# yum upadte subscription-manager* Loaded plugins: langpacks, product-id, search-disabled-repos, subscription- : manager This system is not registered to Red Hat Subscription Management. You can use subscription-manager to register. No such command: upadte. Please use /usr/bin/yum --help [root@test ~]# yum update subscription-manager* Loaded plugins: langpacks, product-id, search-disabled-repos, subscription- : manager This system is not registered to Red Hat Subscription Management. You can use subscription-manager to register. Resolving Dependencies --> Running transaction check ---> Package python-rhsm.x86_64 0:1.17.10-1.el7_3 will be obsoleted ---> Package python-rhsm-certificates.x86_64 0:1.17.10-1.el7_3 will be obsoleted ---> Package subscription-manager.x86_64 0:1.17.15-1.el7 will be updated ---> Package subscription-manager.x86_64 0:1.21.10-2.el7 will be an update --> Processing Dependency: python-dmidecode >= 3.12.2-2 for package: subscription-manager-1.21.10-2.el7.x86_64 ---> Package subscription-manager-gui.x86_64 0:1.17.15-1.el7 will be updated ---> Package subscription-manager-gui.x86_64 0:1.21.10-2.el7 will be an update --> Processing Dependency: rhsm-gtk = 1.21.10-2.el7 for package: subscription-manager-gui-1.21.10-2.el7.x86_64 ---> Package subscription-manager-initial-setup-addon.x86_64 0:1.17.15-1.el7 will be updated ---> Package subscription-manager-initial-setup-addon.x86_64 0:1.21.10-2.el7 will be an update ---> Package subscription-manager-rhsm.x86_64 0:1.21.10-2.el7 will be obsoleting ---> Package subscription-manager-rhsm-certificates.x86_64 0:1.21.10-2.el7 will be obsoleting --> Running transaction check ---> Package python-dmidecode.x86_64 0:3.10.13-12.el7_3 will be updated ---> Package python-dmidecode.x86_64 0:3.12.2-3.el7 will be an update ---> Package rhsm-gtk.x86_64 0:1.21.10-2.el7 will be installed --> Processing Dependency: python-gobject for package: rhsm-gtk-1.21.10-2.el7.x86_64 --> Running transaction check ---> Package pygobject3.x86_64 0:3.14.0-3.el7 will be obsoleted ---> Package python-gobject.x86_64 0:3.22.0-1.el7_4.1 will be obsoleting --> Processing Dependency: python-gobject-base(x86-64) = 3.22.0-1.el7_4.1 for package: python-gobject-3.22.0-1.el7_4.1.x86_64 --> Running transaction check ---> Package pygobject3-base.x86_64 0:3.14.0-3.el7 will be obsoleted ---> Package python-gobject-base.x86_64 0:3.22.0-1.el7_4.1 will be obsoleting --> Processing Dependency: gobject-introspection(x86-64) >= 1.46.0 for package: python-gobject-base-3.22.0-1.el7_4.1.x86_64 --> Running transaction check ---> Package gobject-introspection.x86_64 0:1.42.0-1.el7 will be updated ---> Package gobject-introspection.x86_64 0:1.56.1-1.el7 will be an update --> Processing Dependency: glib2(x86-64) >= 2.56.1 for package: gobject-introspection-1.56.1-1.el7.x86_64 --> Running transaction check ---> Package glib2.i686 0:2.46.2-4.el7 will be updated ---> Package glib2.x86_64 0:2.46.2-4.el7 will be updated ---> Package glib2.i686 0:2.56.1-2.el7 will be an update --> Processing Dependency: libmount.so.1 for package: glib2-2.56.1-2.el7.i686 --> Processing Dependency: libmount.so.1(MOUNT_2.19) for package: glib2-2.56.1-2.el7.i686 ---> Package glib2.x86_64 0:2.56.1-2.el7 will be an update --> Running transaction check ---> Package libmount.x86_64 0:2.23.2-33.el7_3.2 will be updated --> Processing Dependency: libmount = 2.23.2-33.el7_3.2 for package: util-linux-2.23.2-33.el7_3.2.x86_64 ---> Package libmount.i686 0:2.23.2-59.el7 will be installed --> Processing Dependency: libblkid = 2.23.2-59.el7 for package: libmount-2.23.2-59.el7.i686 --> Processing Dependency: libuuid = 2.23.2-59.el7 for package: libmount-2.23.2-59.el7.i686 --> Processing Dependency: libblkid.so.1 for package: libmount-2.23.2-59.el7.i686 --> Processing Dependency: libblkid.so.1(BLKID_1.0) for package: libmount-2.23.2-59.el7.i686 --> Processing Dependency: libblkid.so.1(BLKID_2.15) for package: libmount-2.23.2-59.el7.i686 --> Processing Dependency: libblkid.so.1(BLKID_2.17) for package: libmount-2.23.2-59.el7.i686 ---> Package libmount.x86_64 0:2.23.2-59.el7 will be an update --> Running transaction check ---> Package libblkid.x86_64 0:2.23.2-33.el7_3.2 will be updated ---> Package libblkid.i686 0:2.23.2-59.el7 will be installed ---> Package libblkid.x86_64 0:2.23.2-59.el7 will be an update ---> Package libuuid.i686 0:2.23.2-33.el7_3.2 will be updated ---> Package libuuid.x86_64 0:2.23.2-33.el7_3.2 will be updated ---> Package libuuid.i686 0:2.23.2-59.el7 will be an update ---> Package libuuid.x86_64 0:2.23.2-59.el7 will be an update ---> Package util-linux.x86_64 0:2.23.2-33.el7_3.2 will be updated ---> Package util-linux.x86_64 0:2.23.2-59.el7 will be an update --> Processing Dependency: libsmartcols = 2.23.2-59.el7 for package: util-linux-2.23.2-59.el7.x86_64 --> Processing Dependency: libsmartcols.so.1(SMARTCOLS_2.25)(64bit) for package: util-linux-2.23.2-59.el7.x86_64 --> Processing Dependency: libsmartcols.so.1()(64bit) for package: util-linux-2.23.2-59.el7.x86_64 --> Running transaction check ---> Package libsmartcols.x86_64 0:2.23.2-59.el7 will be installed --> Finished Dependency Resolution

Dependencies Resolved

================================================================================

Package Arch Version Repository Size

Installing: python-gobject x86_64 3.22.0-1.el7_4.1 InstallMedia 16 k replacing pygobject3.x86_64 3.14.0-3.el7 python-gobject-base x86_64 3.22.0-1.el7_4.1 InstallMedia 294 k replacing pygobject3-base.x86_64 3.14.0-3.el7 subscription-manager-rhsm x86_64 1.21.10-2.el7 InstallMedia 297 k replacing python-rhsm.x86_64 1.17.10-1.el7_3 subscription-manager-rhsm-certificates x86_64 1.21.10-2.el7 InstallMedia 212 k replacing python-rhsm-certificates.x86_64 1.17.10-1.el7_3 Updating: subscription-manager x86_64 1.21.10-2.el7 InstallMedia 1.0 M subscription-manager-gui x86_64 1.21.10-2.el7 InstallMedia 364 k subscription-manager-initial-setup-addon x86_64 1.21.10-2.el7 InstallMedia 221 k Installing for dependencies: libblkid i686 2.23.2-59.el7 InstallMedia 185 k libmount i686 2.23.2-59.el7 InstallMedia 182 k libsmartcols x86_64 2.23.2-59.el7 InstallMedia 140 k rhsm-gtk x86_64 1.21.10-2.el7 InstallMedia 470 k Updating for dependencies: glib2 i686 2.56.1-2.el7 InstallMedia 2.4 M glib2 x86_64 2.56.1-2.el7 InstallMedia 2.5 M gobject-introspection x86_64 1.56.1-1.el7 InstallMedia 241 k libblkid x86_64 2.23.2-59.el7 InstallMedia 181 k libmount x86_64 2.23.2-59.el7 InstallMedia 182 k libuuid i686 2.23.2-59.el7 InstallMedia 83 k libuuid x86_64 2.23.2-59.el7 InstallMedia 82 k python-dmidecode x86_64 3.12.2-3.el7 InstallMedia 83 k util-linux x86_64 2.23.2-59.el7 InstallMedia 2.0 M

Transaction Summary

Install 4 Packages (+4 Dependent packages) Upgrade 3 Packages (+9 Dependent packages)

Total download size: 11 M Is this ok [y/d/N]: y Downloading packages:

Error downloading packages: libmount-2.23.2-59.el7.i686: [Errno 256] No more mirrors to try. libsmartcols-2.23.2-59.el7.x86_64: [Errno 256] No more mirrors to try. glib2-2.56.1-2.el7.x86_64: [Errno 256] No more mirrors to try. subscription-manager-rhsm-1.21.10-2.el7.x86_64: [Errno 256] No more mirrors to try. gobject-introspection-1.56.1-1.el7.x86_64: [Errno 256] No more mirrors to try. python-dmidecode-3.12.2-3.el7.x86_64: [Errno 256] No more mirrors to try. glib2-2.56.1-2.el7.i686: [Errno 256] No more mirrors to try. subscription-manager-rhsm-certificates-1.21.10-2.el7.x86_64: [Errno 256] No more mirrors to try. libuuid-2.23.2-59.el7.i686: [Errno 256] No more mirrors to try. python-gobject-3.22.0-1.el7_4.1.x86_64: [Errno 256] No more mirrors to try. util-linux-2.23.2-59.el7.x86_64: [Errno 256] No more mirrors to try. subscription-manager-initial-setup-addon-1.21.10-2.el7.x86_64: [Errno 256] No more mirrors to try. libblkid-2.23.2-59.el7.i686: [Errno 256] No more mirrors to try. libblkid-2.23.2-59.el7.x86_64: [Errno 256] No more mirrors to try. python-gobject-base-3.22.0-1.el7_4.1.x86_64: [Errno 256] No more mirrors to try. subscription-manager-gui-1.21.10-2.el7.x86_64: [Errno 256] No more mirrors to try. libuuid-2.23.2-59.el7.x86_64: [Errno 256] No more mirrors to try. subscription-manager-1.21.10-2.el7.x86_64: [Errno 256] No more mirrors to try. libmount-2.23.2-59.el7.x86_64: [Errno 256] No more mirrors to try. rhsm-gtk-1.21.10-2.el7.x86_64: [Errno 256] No more mirrors to try.

How do i mount new downloaded rpms to standalone system not connected to the internet ? i downloaded the rpms onto a DVD. Can anybody help? what is the mount command.

I tried this with rhel-8.0-x86_64-dvd.iso, but I get:

yum -v repolist enabled

DNF version: 4.0.9
cachedir: /var/cache/dnf
repo: downloading from remote: InstallMedia
Red Hat Enterprise Linux 8.0.0                                            0.0  B/s |   0  B     00:00    
Cannot download '/mnt/rhel-8.0-x86_64.repo': Cannot download repomd.xml: Cannot download repodata/repomd.xml: All mirrors were tried.

The repo config file:

[InstallMedia]
name=Red Hat Enterprise Linux 8.0.0
mediaid=None
metadata_expire=-1
gpgcheck=1
cost=500
enabled=1
baseurl=/mnt/rhel-8.0-x86_64.repo
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-redhat-release

/mnt/rhel-8.0-x86_64.repo definitely exists
dr-xr-xr-x. 7 root root 2048 Apr  4 04:39 /mnt/rhel-8.0-x86_64.repo/

Any ideas would be greatly appreciated!

With RHEL 8 you need to create 2 repos for BaseOS and AppStream which are inside the root of the iso. If you have the iso mounted at /mnt/rhel-8.0-x86_64.repo, then we want to have a repo file like so:

[InstallMedia-BaseOS]
name=Red Hat Enterprise Linux 8 - BaseOS
metadata_expire=-1
gpgcheck=1
enabled=1
baseurl=file:///mnt/rhel-8.0-x86_64.repo/BaseOS/
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-redhat-release

[InstallMedia-AppStream]
name=Red Hat Enterprise Linux 8 - AppStream
metadata_expire=-1
gpgcheck=1
enabled=1
baseurl=file:///mnt/rhel-8.0-x86_64.repo/AppStream/
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-redhat-release

There is a RHEL 8 DVD KCS or you can use the Repository Lab to help create the necessary files

OMG - I was about to try that! Worked like a charm. (I didn't have a 7.X iso to compare to). Now to check your links for a more thorough understanding. Again, thanks for the quick and helpful response!

This what I get: This system is not registered with an entitlement server. You can use subscription-manager to register. InstallMedia | 4.3 kB 00:00:00 file:///media/iso/repodata/repomd.xml: [Errno -1] Error importing repomd.xml for InstallMedia: Damaged repomd.xml file

This is what's in the repomd.xml ^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^

Lets make sure the iso is not corrupted from the download. You can check the sha256sum which we can compare to the portal.

For instance the 7.7 Binary DVD shows SHA-256 Checksum: 88b42e934c24af65e78e09f0993e4dded128d74ec0af30b89b3cdc02ec48f028 . If you're not seeing this, then you may want to redownload the iso to ensure it's a working copy.

Download Red Hat Enterprise Linux

Perfect! Thank you

Thanks for writing it. In first attempt, able to crate media repo.

Can you please provide a document for creating a local rhel7 repository using online process(repo sync), instead of DVD method.

Followed instructions mentioned in the above link for RHEL 6 and it worked, but when I tried below steps for RHEL 7 it is not downloading any thing. 1. mkdir /var/www/html/rhel-7-server-rpms 2. reposync --gpgcheck -l --repoid=rhel-7-server-rpms --download_path=/var/www/html --downloadcomps --download-metadata

output: Nothing...

The system should be able to see rhel-7-server-rpms in the yum repolist

rhel-7-server-rpms/7Server/x86_64                     Red Hat Enterprise Linux 27,002

Can you download any packages from there?

# yumdownloader bash

If you reposync to another directory does it work or if you clear cache? Is there any useful output if you add a -v to the command?

If the issue is not clear, I would suggest that we open a case regarding this issue to further investigate.

Yes, I have tried the above steps as well, but no go...

And also I am trying to setup in RHEL 6 Server.

reposync can only download content from repositories it can access. By default a RHEL 6 system can not access RHEL 7 repositories. If you are trying to sync the RHEL 7 repositories from the RHEL 6 system, it won't see those. You need a VM or machine for each Product/Arch/Major Release of RHEL that you need to sync.

I would recommend opening a case so we can investigate this further if you need further assistance.

this solution does not work on rhel-8. refer this for rhel-8 : https://access.redhat.com/discussions/3763091

I'll see about linking each to one another. Since each DVD is different there are minor differences for each major release. Instead of one large KCS, it's broken into one per release.

For RHEL 8 we have a KCS

You can always refer to the Master Article or utilize the lab.

I am working with the RHEL 8 binary disk and reached the "yum repolist enabled" command, which failed with the following message...

Updating Subscription Management repositories.
Red Hat Enterprise Linux 8.1.0                  0.0  B/s |   0  B     00:00    
Failed to download metadata for repo 'InstallMedia'
Error: Failed to download metadata for repo 'InstallMedia'

...DVD is mounted on /mnt/disc per the instructions.

~~~~~~~~~~ sh-4.4# ls -C -l /mnt/disc total 48 dr-xr-xr-x. 4 root root 2048 Oct 15 08:33 AppStream dr-xr-xr-x. 4 root root 2048 Oct 15 08:33 BaseOS dr-xr-xr-x. 3 root root 2048 Oct 15 08:33 boot -r--r--r--. 1 root root 8266 Oct 15 08:28 EULA -r--r--r--. 1 root root 1455 Oct 15 08:28 extra_files.json -r--r--r--. 1 root root 18092 Oct 15 08:28 GPL dr-xr-xr-x. 2 root root 2048 Oct 15 08:33 images -r--r--r--. 1 root root 103 Oct 15 08:28 media.repo dr-xr-xr-x. 3 root root 2048 Oct 15 08:33 ppc -r--r--r--. 1 root root 1669 Oct 15 08:28 RPM-GPG-KEY-redhat-beta -r--r--r--. 1 root root 5134 Oct 15 08:28 RPM-GPG-KEY-redhat-release -r--r--r--. 1 root root 1796 Oct 15 08:33 TRANS.TBL ~~~~~~~~~~~~~~~~~~~~~~~~

With RHEL 8, there are 2 repositories in the Binary DVD, not just one. You have to create a [repo-entry] for both the AppStream and BaseOS directory on that dvd. There are steps for RHEL 8 in this KCS or you can use the Lab to assist you.

Really helpful. Thank you!

i just want this to install from local iso and still, it kept on trying to fetch the remote which block at the the moment

yum install sssd Loaded plugins: langpacks, product-id, search-disabled-repos, subscription-manager https://cdn.redhat.com/content/dist/rhel/server/7/7/x86_64/os/repodata/repomd.xml: [Errno 14] curl#22 - "The requested URL returned error: 503" Trying other mirror.

One of the configured repositories failed (Red Hat Enterprise Linux 7 Server (RPMs)), and yum doesn't have enough cached data to continue. At this point the only safe thing yum can do is fail. There are a few ways to work "fix" this:

 1. Contact the upstream for the repository and get them to fix the problem.

 2. Reconfigure the baseurl/etc. for the repository, to point to a working
    upstream. This is most often useful if you are using a newer
    distribution release than is supported by the repository (and the
    packages for the previous distribution release still work).

 3. Run the command with the repository temporarily disabled
        yum --disablerepo=rhel-7-server-rpms ...

 4. Disable the repository permanently, so yum won't use it by default. Yum
    will then just ignore the repository until you permanently enable it
    again or use --enablerepo for temporary usage:

        yum-config-manager --disable rhel-7-server-rpms
    or
        subscription-manager repos --disable=rhel-7-server-rpms

 5. Configure the failing repository to be skipped, if it is unavailable.
    Note that yum will try to contact the repo. when it runs most commands,
    so will have to try and fail each time (and thus. yum will be be much
    slower). If it is a very temporary problem though, this is often a nice
    compromise:

        yum-config-manager --save --setopt=rhel-7-server-rpms.skip_if_unavailable=true

failure: repodata/repomd.xml from rhel-7-server-rpms: [Errno 256] No more mirrors to try. https://cdn.redhat.com/content/dist/rhel/server/7/7/x86_64/os/repodata/repomd.xml: [Errno 14] curl#22 - "The requested URL returned error: 503"

If the other repositories are still enabled, then yum will continue to look for them. What I recommend is that you clear the cache and disable all the other repositories temporarily so you can install what you need.

# rm -rf /var/cache/yum/
# yum install sssd --disablerepo="*" --enablerepo="InstallMedia"

To permanently disable repositories from the cdn, you can use subscription-manager

# subscription-manager repos --disable="rhel-7-server-rpms"

Great... It is really helpful.

Is there a similar way to get other repos like optional, extras, etc... ?

The optional and extras repository is not available on an iso format. They are only available to registered systems or via the package browser.

I am trying to update from 7.6 to 7.9 and followed the mentioned process. but while doing yum update , I am getting message. No packages marked for update

Verify the 7.9 Binary DVD is mounted at the location designated.

# mount | grep /mnt/disc
# ls /mnt/disc/Packages/redhat-release*

We should have a repository named InstallMedia. Clear the cache, disable all other repos and check if you can see the package count.

# rm -rf /var/cache/yum
# yum repolist --disablerepo="*" --enablerepo=InstallMedia
InstallMedia                                                         | 2.8 kB  00:00:00
(1/2): InstallMedia/group                                            | 628 kB  00:00:00
(2/2): InstallMedia/primary                                          | 2.1 MB  00:00:00
InstallMedia                                                                      5230/5230
repo id                                      repo name                                status
InstallMedia                                 7.9 DVD                                  5,230

Now we can compare what you have installed vs what is available in the repository.

Installed Packages
kernel.x86_64                    3.10.0-1160.2.1.el7                     @rhel-7-server-rpms
Available Packages
kernel.x86_64                    3.10.0-1160.el7                         InstallMedia

In my case, my installed kernel is higher then the Available and no updates would be available.

If you have further questions, I recommend opening a Support Ticket for further assistance.

John, Thank You very much for the solution, look like I downloaded the source ISO which cant be used for updating the system, now got the correct Binary ISO and able to update the version. Now will be trying leapp to updrade the system to 8.2.

does not work in RHEL 8 error message is: "Failed to synchronize cache for repo 'InstallMedia', ignoring this repo."

With RHEL 8, we have 2 repositories in the ISO. AppStream and BaseOS. We need 2 configurations (These can be in the same .repo file)

# cat /etc/yum.repos.d/my.repo 
[dvd-BaseOS]
name=DVD for RHEL8 - BaseOS
baseurl=file:///media/rhel8dvd/BaseOS
enabled=1
gpgcheck=1
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-redhat-release

[dvd-AppStream]
name=DVD for RHEL8 - AppStream
baseurl=file:///media/rhel8dvd/AppStream
enabled=1
gpgcheck=1
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-redhat-release

Need to set up yum repository for locally-mounted DVD on Red Hat Enterprise Linux 8

Is it possible to use these DVDs with no Subscription (without paying)

Hi Jon,

No - you need a subscription in order to access the installation ISO (boot.iso/dvd.iso) files. :)
You may want to check out the free, no-cost Red Hat Developer Subscription for Individuals.

Regards,
Christian

but they are available in the provided link (https://access.redhat.com/downloads/content/69/ver=/rhel---7/), and I already downloaded the Red Hat Enterprise Linux 7.9 Binary DVD and I do not have a subscription

Hi Jon,

Not sure why you have access without a subscription ... please check https://access.redhat.com/management. :)
One thing's for sure, by using a RHEL system without a subscription you would violate the terms and conditions.

Regards,
Christian

My mistake, After checking, I found I have a developer subscription

Thanks for your answer

Great Jon ! Glad you could sort it out ... Thanks for clarification. :)

Regards,
Christian

Hello Christian, what is the difference between using (boot.iso/dvd.iso) files ?

I downloaded the dvd.iso but when i tried to run some commands to mount it i got yum repolist

repolist=0

Hello !

The difference ? The boot.iso is a network installer medium that lets you download the latest packages during
the installation process (valid for RHEL 8), and/or can be used to install the packages being located on a local
network. The dvd.iso contains everything that is needed to install the system without having internet access. :)

Regards,
Christian

Christian, Thanks very much.

You're welcome ! :)

Christian, I'm a bit confused about something. So, I need Red Hat rpm repo packages that I need to burn on DVD. I downloaded *rhel-server-7.9-x86_64-dvd.iso but i do not feel like this is the file that has all the rpm packages. Please help me understand. I feel like the packages should end with .rmp lol. Or maybe just the individual software. I need this help asap. I want to go ahead and burn it no the DVD and go ahead and try creating my repo file and progress on creating the Local repository. Thanks

Hello !

The dvd.iso is what you need to install the system, it contains all RPM files that are needed. You have to burn
this iso file to a DVD, but I recommend to create an USB medium because it is a bit "huge". When the system
is installed and running you can install additional software from the Red Hat repositories. Alternatively create
a local repository, as being described in this solution article, and then use the boot.iso to install the system. :)

Regards,
Christian

Just want to say that it worked on a Red Hat EL 8 with it's binary DVD, there is only one difference, As the binary DVD contains 2 repos, you need to specify which repo you want to use in the /etc/yum.repos.d/rhel7dvd.repo like :

baseurl=file:///mnt/disc/BaseOS/

/!\ Replace "BaseOS" with "AppStream" if it is the repo you want to use.

Thank you very much for your well done tutorial.

Hi Nathan,

There is no need to choose.

vi /etc/yum.repos.d/dvd.repo

[DVD-BaseOS]
name=DVD-BaseOS
baseurl=file:///mnt/disc/BaseOS/
enabled=1
gpgcheck=1
[DVD-AppStream]
name=DVD-AppStream
baseurl=file:///mnt/disc/AppStream
enabled=1
gpgcheck=1

Will make both repos available simultaniously.

Regards,

Jan Gerrit

Greate one ! Didn't knew it could worked.

On the time I've made it, I tryed to create 2 repo-files (one for each repo) but didn't worked.

Regards,

Nathan

Excellent!

Works for me! Thanks!

I get errors are the yum repolist enable, cannot find the /mnt/disc/repodata/respond.xml in fact I am missing folders and files, assume they are hidden but cannot unhide them.

can upgrade rhel 7 to rhel 7.9 directly using iso image?

That really depends on what packages you have installed already. Yes it is possible to update from 7.0 > 7.9 with the Binary DVD. In most cases, you will have installed a package that was, over the course of the RHEL 7 lifetime, moved to the optional repository which is not on the Binary DVD. There is nothing wrong with testing. Setup the DVD as a repo and run yum update --assumeno. If you get a transaction summary, then it resolved all the dependencies which means you can test the update. With changes to selinux, I would set that to permissive for the update so new rules can be applied without affecting your login shell

Hi,

I tried to upgrade with this but got an error.

  1. mount the DVDrom onto /mnt
mount -o loop /dev/cdrom /mnt
  1. I created the media.repo, and disabled all the other repos. cat /etc/yum.repo.d/media.repo [InstallMedia] name=rhel8 basurl=file:///mnt mediaid=None gpgcheck=1 gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-redhat-release cost=500 enabled=1

  2. Checked to see if the repositories worked:

yum repolist

file:///mnt/repodata/repomd.xml: [Error 13] curl#37 = "Couldn't open file /mnt/repodata/repomd.xml" ...

This is not surprising because there are two repomd.xml in /mnt/AppStream/repodata/repomd.xml /mnt/BaseOS/repodata/repomd.xml

What is the supported method to upgrade from 7.9 to 8.6 using the RHEL 8.6 DVDrom?

Thanks.

Leapp using an iso as a target is a feature request in progress. For now we have to use repositories. The best option is to host the dvd over http for leapp to reach out to. If we can only have it local, then it needs to be over http and the target is localhost.

Customizing your Red Hat Enterprise Linux in-place upgrade - Known Issues

Unfortunately leapp can not target a repo with a baseurl of file:// * 1841192 – leapp fails to use repositories configured with file:///