EPEL, which stands for Extra Packages for Enterprise Linux, is an open-source and free repository that provides extra packages for Enterprise Linux. The EPEL repository was created because Fedora contributors wanted to use Fedora packages they maintain on RHEL and other compatible distributions such as CentOS, Rocky Linux, and AlmaLinux, to name a few.
The EPEL repository is also known for bringing additional packages and updated packages that may be behind in the core repository, along with dependencies required by other external repositories, for example, the Remi PHP repository.
In the following tutorial, you will learn how to install the EPEL repository and the EPEL Next repository, which is the next testing version that can come into use for newer packages when major upgrades occur to the core distribution on CentOS 9 Stream.
Table of Contents
Update CentOS Stream
Before proceeding with the tutorial, update your system to ensure all existing packages are up to date.
sudo dnf upgrade --refresh -y
Situational – Remove DNF Subscription Manager
For users that have just installed CentOS Stream, you may encounter issues with “This system is not registered with an entitlement server. You can use subscription-manager to register,” then use the following command to remove the subscription manager.
sudo dnf erase subscription-manager -y
As mentioned above, all the subscription-based lockouts have been removed.
Install the EPEL/EPEL Next Repository
The first task is to install the EPEL repository. The recommendation is to install both repositories, given CentOS 9 Stream is an upstream version for RHEL. Now often packages may be required from it.
First, enable the CRB.
sudo dnf config-manager --set-enabled crb
Next, install EPEL use the following (dnf) terminal command:
sudo dnf install \ https://dl.fedoraproject.org/pub/epel/epel-release-latest-9.noarch.rpm \ https://dl.fedoraproject.org/pub/epel/epel-next-release-latest-9.noarch.rpm
Confirm the EPEL or EPEL Next Installation
Now that you have installed the EPEL repository, verifying the installation is a good idea. The easiest and quickest way is to use the dnf repolist command.
sudo dnf repolist | grep epel
As above, the repository is shown and successfully installed.
EPEL Repository Tips
One of the handy tricks when using EPEL or EPEL Next repository is to list the available packages.
sudo dnf --disablerepo="*" --enablerepo="epel" list available
Example output (Note Large Printout):
As above, you can further filter the list to find specific packages. The example will find phpMyAdmin.
sudo dnf --disablerepo="*" --enablerepo="epel" list available | grep -i phpMyAdmin
EPEL Next Example:
sudo dnf --disablerepo="*" --enablerepo="epel-next" list available | grep -i phpMyAdmin
Now that you have found the EPEL containing the packages you want to install, use the following command to install them straight out of the EPEL repository.
Example (Replace with your package name):
sudo dnf --enablerepo="epel" install phpMyAdmin
Alternatively, users with EPEL Next can use the following command if a newer package exists.
sudo dnf --enablerepo="epel-next" install phpMyAdmin
Note, you can often not use the –enablerepo and use the standard installation command. However, this doesn’t always work when multiple options are present.
How to Remove (Uninstall) EPEL or EPEL Next
Ideally, you should not need to remove the repository once installed. However, if you must remove it, use the following command.
To remove EPEL repository:
sudo dnf remove epel-release
To remove EPEL Next repository:
sudo dnf remove epel-next-release
Comments and Conclusion
In the tutorial, you have learned how to import the EPEL repository on CentOS 9 Stream, along with various options and tips in using EPEL to your advantage on your system.
Overall, EPEL is a well-known and highly used repository. You will likely need to install this on downstream versions of RHEL as it often contains essential packages every day, especially on servers.