How to Install EPEL Repository in RHEL 9 Linux

Installing the EPEL repository is one of the most recommended steps after you install RHEL 9. To make things easy for you, we are not just going to show you installation steps but rather we are going to explain what is EPEL, what makes it so special, and how you can use EPEL to install packages.

So let’s start with a brief introduction to EPEL.

What is EPEL Repository?

EPEL stands for Extra Packages for Enterprise Linux which is created and maintained by Fedora Special Interest Group. This repository is known for bringing a high-quality set of additional packages for Enterprise Linux which also includes RHEL 9.

The specialty of EPEL is that it is based on Fedora counterparts so it is never going to conflict with or replace any packages in your Enterprise Linux distribution.

The major reason why it is so popular is the set of features it is bundled with.

  • EPEL enables you access to numerous amounts free of packages.
  • Being managed by the Fedora group, it is 100% open-source and secure.
  • Never conflicts or replaces existing packages as it uses Fedora counterparts at its core.
  • You are assured of getting only high-quality and enterprise-grade packages.

Install EPEL Repository in RHEL 9

Once we are done with the introductory part, it’s time to install the EPEL repository in our RHEL 9 system. So let’s start with our first step.

Step 1: Updating RHEL 9 Repositories

As every command which we are going to demonstrate is going to use elevated privileges, we are going to switch to the root user by the following command:

$ sudo -i

Now, let’s update repository indexes and update the packages (if any) by the following command:

# dnf update -y
Update RHEL 9 Repositories
Update RHEL 9 Repositories

Step 2: Add EPEL Repository to RHEL 9

Once we are done updating repositories, it’s time to install the EPEL repository. For that, we have to enable codeready builder repository for our RHEL system by utilizing the given command:

# subscription-manager repos --enable codeready-builder-for-rhel-9-$(arch)-rpms
Add Codeready Builder Repo
Add Codeready Builder Repo

After enabling the codeready repository, let’s install the EPEL repository by the following command:

# dnf install -y
Install EPEL in RHEL 9
Install EPEL in RHEL 9

After installing EPEL, let’s cross-check the whole process by listing all the repositories in our system.

# yum repolist
Check EPEL in RHEL 9
Check EPEL in RHEL 9

You can see that our installed EPEL Repository has been listed which means we have successfully installed the EPEL repository in our system.

Step 3: Installing Packages Using EPEL in RHEL 9

This section will demonstrate how you can list available packages in EPEL, search for individual packages from the EPEL repository and install the required package.

So let’s start with how you can list the available packages in the EPEL repository by the following command:

# dnf --disablerepo="*" --enablerepo="epel" list available
List Packages from EPEL
List Packages from EPEL

But if you are looking for a specific package, you can easily search by using the grep command. For example, if we are looking for neofetch, we are required to use the following command:

# yum --disablerepo="*" --enablerepo="epel" list available | grep 'neofetch'
List Package from EPEL
List Package from EPEL

As you can clearly see, the neofetch package is available named “neofetch.noarch”. But if you want more details about neofetch.noarch, we can easily extract details about it by utilizing the given command:

# yum --enablerepo=epel info neofetch.noarch
List Package Info
List Package Info

You can clearly see, that it gets us a detailed description of the package which is really helpful for identifying the package which we are looking for.

To install the intended package, we will be utilizing the following command:

# yum --enablerepo=epel install neofetch.noarch -y
Install Package from EPEL
Install Package from EPEL

You can clearly see, that neofetch is working as well as we intended.

Check RHEL 9 Info
Check RHEL 9 Info

This guide was intended to explain how you can easily install the EPEL repository, search for packages and install them.

Sagar Sharma
I'm a software engineer trying my best to bring open-source software to a general audience. Being a Linux author solves my purpose.

Each tutorial at TecMint is created by a team of experienced Linux system administrators so that it meets our high-quality standards.

Join the TecMint Weekly Newsletter (More Than 156,129 Linux Enthusiasts Have Subscribed)
Was this article helpful? Please add a comment or buy me a coffee to show your appreciation.

Got Something to Say? Join the Discussion...

Thank you for taking the time to share your thoughts with us. We appreciate your decision to leave a comment and value your contribution to the discussion. It's important to note that we moderate all comments in accordance with our comment policy to ensure a respectful and constructive conversation.

Rest assured that your email address will remain private and will not be published or shared with anyone. We prioritize the privacy and security of our users.