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
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
After enabling the codeready repository, let’s install the EPEL repository by the following command:
# dnf install https://dl.fedoraproject.org/pub/epel/epel-release-latest-9.noarch.rpm -y
After installing EPEL, let’s cross-check the whole process by listing all the repositories in our system.
# yum repolist
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
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'
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
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
You can clearly see, that neofetch is working as well as we intended.
This guide was intended to explain how you can easily install the EPEL repository, search for packages and install them.