How to Install EPEL on Rocky Linux 9 | 8
EPEL, which stands for Extra Packages for Enterprise Linux, is an open-source and free repository that provides extra packages for Enterprise Linux that can benefit Rocky Linux 9 or 8 distributions. The following tutorial will teach you how to install and enable EPEL on your Rocky Linux desktop or server.
Recommended Steps Before Installation
Before proceeding with the tutorial, update your system to ensure all existing packages are up to date.
sudo dnf upgrade --refresh
Import EPEL & EPEL Next Repository
The first task is to install the EPEL repository. The recommendation is to install both repositories. Ensure you match your version of Rocky Linux with the correct EPEL repository.
Import EPEL for Rocky Linux 9
First, enable the CRB.
sudo dnf config-manager --set-enabled crb
Next, install EPEL using 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
Import EPEL for Rocky Linux 8
Like Rocky Linux 9, install EPEL using the following (dnf) terminal command for Rocky Linux 8 distribution.
sudo dnf install \
https://dl.fedoraproject.org/pub/epel/epel-release-latest-8.noarch.rpm \
https://dl.fedoraproject.org/pub/epel/epel-next-release-latest-8.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.
dnf repolist | grep epel
Example output:
epel Extra Packages for Enterprise Linux 9 - x86_64
epel-next Extra Packages for Enterprise Linux 9 - Next - x86_64
As mentioned 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.
dnf --disablerepo="*" --enablerepo="epel" list available
The example will find phpMyAdmin.
EPEL Example:
sudo dnf --disablerepo="*" --enablerepo="epel" list available | grep -i phpMyAdmin
EPEL Next Example:
sudo dnf --disablerepo="*" --enablerepo="epel-next" list available | grep -i phpMyAdmin
Example output:
phpMyAdmin.noarch 5.2.0-1.el9 epel
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 that you can often not use the –enablerepo and 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.
Remove the EPEL repository
sudo dnf remove epel-release
Remove EPEL Next repository
sudo dnf remove epel-next-release
Comments and Conclusion
For most Rocky Linux users, I would suggest installing this repository if you are sure to install additional packages from other third-party repositories, as dependencies are often required out of EPEL.