In this tutorial, we will learn about How to install EPEL Repository in Rocky Linux. Rocky Linux is a Linux distribution that comes with strong community support. In Rocky Linux, to enhance the software ecosystem, the EPEL (Extra Packages for Enterprise Linux) repository becomes invaluable. The EPEL repository provides a collection of additional high-quality packages that are not included in the default Rocky Linux repositories.
[Solved] How to Install EPEL Repository in Rocky Linux
Also Read: How to Install Keycloak-23.0.0 on Windows [9 Easy Steps]
The packages provided by the EPEL repository are developed by the Fedora developer community group. There are two ways to add EPEL repository in the Linux system. The first method to add epel repository is by installing epel-release package using dnf package manager. The second method is by installing the epel-release.rpm manually from fedora official website. We will look at both the installation method thoroughly in the next section to install the EPEL repository. Please make sure that the prerequisites given below are met before you start to follow the methods to Install the EPEL repository otherwise the installation may fail.
Prerequisite
- Rocky Linux Operating System Installed
- Sudo user/Root user privilege required
- Access to internet required
1. Install using DNF Package Manager
In this method, we will install the epel-release package using the dnf package manager which is by default present in Rocky Linux system. To do so, connect to your Linux machine and switch to the sudo/root user. I am using root user. Next, check if epel repository is already installed in the system by using below command. As you see in the output, currently only standard Rocky Linux repositories are installed.
[[email protected] ~]# dnf repolist repo id repo name appstream Rocky Linux 9 - AppStream baseos Rocky Linux 9 - BaseOS extras Rocky Linux 9 - Extras
NOTE:
Next, we will install the epel-release package which will add the epel repository in the system. To do so, use below command.
[[email protected] ~]# dnf install epel-release Last metadata expiration check: 0:12:20 ago on Mon 04 Dec 2023 09:57:55 PM +03. Dependencies resolved. ======================================================================== Package Architecture Version Repository Size ======================================================================== Installing: epel-release noarch 9-4.el9 extras 19 k Transaction Summary ======================================================================== Install 1 Package Total download size: 19 k Installed size: 25 k Is this ok [y/N]: y Downloading Packages: epel-release-9-4.el9.noarch.rpm 49 kB/s | 19 kB 00:00 ------------------------------------------------------------------------ Total 18 kB/s | 19 kB 00:01 Running transaction check Transaction check succeeded. Running transaction test Transaction test succeeded. Running transaction Preparing : 1/1 Installing : epel-release-9-4.el9.noarch 1/1 Running scriptlet: epel-release-9-4.el9.noarch 1/1 Many EPEL packages require the CodeReady Builder (CRB) repository. It is recommended that you run /usr/bin/crb enable to enable the CRB repository. Verifying : epel-release-9-4.el9.noarch 1/1 Installed: epel-release-9-4.el9.noarch Complete!
Next, verify if the epel repository is added by using the command to list all the repositories present in the system. If you see the “Extra Packages for Enterprise Linux 9 – x86_64” repository in the command output, it means epel repository is successfully installed and added in the system.
[[email protected] ~]# dnf repolist repo id repo name appstream Rocky Linux 9 - AppStream baseos Rocky Linux 9 - BaseOS epel Extra Packages for Enterprise Linux 9 - x86_64 extras Rocky Linux 9 - Extras
2. Install Manually from Fedora Website
In this method, we will manually download the EPEL RPM package in the system and then install it. To do so, go to the fedora official website and choose the suitable epel version based on your requirement to install in the system. Use below command to install the epel repository.
//Install EPEL 7 [[email protected] ~]# dnf -y install https://dl.fedoraproject.org/pub/epel/epel-release-latest-7.noarch.rpm //Install EPEL 8 [[email protected] ~]# dnf -y install https://dl.fedoraproject.org/pub/epel/epel-release-latest-8.noarch.rpm //Install EPEL 9 [[email protected] ~]# dnf -y install https://dl.fedoraproject.org/pub/epel/epel-release-latest-9.noarch.rpm
Next, after installation completes, verify if the repository is successfully installed and added in the system using below command.
[[email protected] ~]# dnf repolist repo id repo name appstream Rocky Linux 9 - AppStream baseos Rocky Linux 9 - BaseOS epel Extra Packages for Enterprise Linux 9 - x86_64 extras Rocky Linux 9 - Extras
How to Enable EPEL Repository
When you install the epel repository first time in the system, by default the repository is enabled. There could be a case where the epel repository is disabled and you want to enable it back. In such case, if you want to enable the epel Repository in your system, use below command.
[[email protected] ~]# dnf config-manager --set-enabled epel
After enabling the repository, execute below command. If you see the repository in the command output, it means the repository is enabled.
[[email protected] ~]# dnf repolist | grep "Extra Packages for Enterprise Linux 9 - x86_64" epel Extra Packages for Enterprise Linux 9 - x86_64
How to Disable EPEL Repository
If you want to disable EPEL Repository in your system, use below command.
[[email protected] ~]# dnf config-manager --set-disabled epel
After you disable the EPEL repository, execute below command. If output is empty, it means repository is disabled successfully.
[[email protected] ~]# dnf repolist | grep "Extra Packages for Enterprise Linux 9 - x86_64"
How to Uninstall EPEL Repository
To uninstall/remove the epel repository from the system, use below command.
[[email protected] ~]# dnf remove epel-release.noarch
Summary
We have successfully installed the EPEL repository in the Rocky Linux by following two methods given in this tutorial. We have also learnt about how to enable or disable the EPEL repository in the Rocky Linux post the installation. We finally learnt about how to remove the EPEL repository from the System.