Home RHEL How to Install Software with Yum/Dnf Using RHEL ISO Image

How to Install Software with Yum/Dnf Using RHEL ISO Image

Linux operating system attributes such as easy configuration, open-source projects support, access to container development tools, and other numerous functionalities are not the only reasons why some users fancy RHEL 8 over other Linux operating system distributions.

The release of RHEL 8 has more muscles to flex to its user community. You can now set up RHEL ISO local repo on your installed RHEL 8 server system from an RHEL OS ISO file or installation DVD.

Achieving this objective gives you an alternative approach to installing software packages on your RHEL system with the following other benefits:

  • An alternative approach to upgrading your RHEL server system.
  • Upgrade a secure RHEL-based environment with no internet connection setup.
  • Update your default RHEL server packages without connecting to the internet.

Two package repositories are supported by the RHEL 8 OS architecture and they are BaseOS and Application Stream. The BaseOS repository deals with underlying OS-related packages. On the other hand, Application Stream deals with application-related databases, developer tools, and packages.

Before continuing with this article, make sure you are a root user or have Sudoer privileges on the RHEL 8 system you are using.

Download RHEL ISO Image

The downloaded ISO file needs to be the full installation image of the latest recommended RHEL operating system release. You can head over to the official RHEL download page and grab the DVD image as shown.

Download RHEL ISO Image
Download RHEL ISO Image

Mount RHEL DVD ISO Image

To mount the downloaded RHEL 8 ISO image, you need to create a mounting point inside the /mnt filesystem of your RHEL 8 operating system.

$ sudo mkdir -p /mnt/disc

Now that the mounting point has been created, navigate to the downloaded copy of your RHEL 8 ISO file and issue a mount command:

$ sudo mount -o loop rhel-8.5-x86_64-dvd.iso /mnt/disc
Mount RHEL DVD ISO Image
Mount RHEL DVD ISO Image

If your RHEL ISO image exists on DVD media, you will need the following set of commands to mount it:

$ sudo mkdir -p /mnt/disc
$ sudo mount /dev/sr0 /mnt/disc

Creating Local RHEL Repository

Since we mounted the RHEL 8 ISO file under the system’s /mnt folder, we should now be able to comfortably retrieve a copy of the file media.repo and transfer it to the system directory /etc/yum.repos.d/ under a new name rhel8.repo.

$ sudo cp /mnt/disc/media.repo /etc/yum.repos.d/rhel8.repo 

We can set the permission setting of this copied repo file (rhel8.repo) to 0644 such that read and write permissions are reserved for the owner of the file (sudoer/root user) and other users can only read.

$ sudo chmod 644 /etc/yum.repos.d/rhel8.repo

Now open and edit the /etc/yum.repos.d/rhel8.repo file.

$ sudo nano /etc/yum.repos.d/rhel8.repo 

The final edit of the above file should look like the following:

Creating Local RHEL Repository
Creating Local RHEL Repository

After creating a local repository, clear your system cache.

$ sudo yum clean all

Now try to get the RHEL 8 DVD repo package list with the following command:

$ sudo yum repolist enabled 
List Local RHEL Repository
List Local RHEL Repository

With no errors from the above command, we should be able to run a system update:

$ sudo yum update
Update RHEL Using Local Repository
Update RHEL Using Local Repository

Install Software Packages Using RHEL Local Repo

Finally, you can list available packages on the local yum repository before installing them.

$ sudo yum list
List Software Packages
List Software Packages

After you identify the package you wish to install, implement the following package installation syntax:

$ sudo yum install PACKAGE_NAME 

For example, the zsh.x86_64 package on the above screen capture can be installed on our RHEL machine without the need for an internet connection:

$ sudo yum install zsh
Install Software Using Local Yum Repo
Install Software Using Local Yum Repo

RHEL ISO Local Repo’s approach of installing software packages is a great advantage for users who want to explore what RHEL has to offer without the demand for a fixed internet connection.

Ravi Saive
I am an Experienced GNU/Linux expert and a full-stack software developer with over a decade in the field of Linux and Open Source technologies. Founder of TecMint.com, LinuxShellTips.com, and Fossmint.com. Over 150+ million people visited my websites.

Each tutorial at UbuntuMint is created by a team of experienced writers so that it meets our high-quality standards.

Was this article helpful? Please add a comment to show your appreciation and support.

Got something to say? Join the discussion.

Thanks for choosing to leave a comment. Please keep in mind that all comments are moderated according to our comment policy, and your email address will NOT be published or shared. Please Do NOT use keywords in the name field. Let's have a personal and meaningful conversation.