How To Set Up RHEL To Use ISO As Local Repository?

How to set up RHEL to use ISO as local repository?

Issue Description:

Installing the Automation Suite requires additional RPM packages, some of which are not included in the default Red Hat installation. For users who do not have internet access or a private repository, it is difficult to install all the required RPM packages offline.

One option is to mount the Red Hat ISO and use it as a software repository.

Prerequisites:

Root access

Redhat ISO

  • Same version as the installed RHEL
  • Must be full version (x86_64DVD iso) , the Boot iso won’t work

General Process:

  1. Create a directory

mkdir /mnt/RHEL

  1. Insert or connect the ISO to the VM's C drive

mount /dev/sr0 /mnt/RHEL

  • or directly mount the iso file .

mount /path/to/image.iso /mnt/RHEL -o loop

  1. Setup local repository to read the mounted ISO
  • create localyum.repo

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

  1. Add the below content and save the file, update the highlighted folder path to match the environment.

[BaseOS]

name=BaseOS

baseurl=file:///mnt/RHEL/BaseOS

enabled=1

gpgcheck=0

[AppStream]

name=AppStream

baseurl=file:///mnt/RHEL/AppStream

enabled=1

gpgcheck=0

  1. Save the file and try to install the necessary software package.