How to Install EPEL Repository on RHEL or Rocky or AlmaLinux

EPEL (Extra Packages for Enterprise Linux) repository is a community-driven repository that provides additional software packages for RHEL (Red Hat Enterprise Linux), Rocky Linux, and AlmaLinux distributions. It provides a wide range of packages that are not available in the default repositories, including popular packages such as Ansible, Docker, and many more. In this blog, we will discuss how to install EPEL repository on RHEL or Rocky or AlmaLinux. 

Prerequisites

Before proceeding with the installation process, make sure that your system meets the following requirements:

  • A running instance of RHEL, Rocky Linux or AlmaLinux
  • A user account with sudo privileges
  • A stable internet connection

Steps to Install EPEL repository on RHEL or Rocky or AlmaLinux

There are two methods to install the EPEL repository on RHEL, Rocky, and AlmaLinux:

  1. Installing EPEL using the Yum package manager
  2. Installing EPEL using the DNF package manager

Method 1: Installing EPEL using the Yum package manager

Yum (Yellowdog Updater, Modified) is a package manager that is used to install, update, and remove packages in RHEL and its derivatives. To install EPEL using the Yum package manager, follow these steps:

Step 1: Install the EPEL repository configuration package

To install the EPEL repository, first, we need to download and install the EPEL repository configuration package. Run the following command to download and install the EPEL repository configuration package:

sudo yum install epel-release

How to Install EPEL Repository on RHEL or Rocky or AlmaLinux

Sample output:

[sysadminxpert@RockyLinux ~]$ sudo yum install epel-release
Last metadata expiration check: 21:47:32 ago on Thu 30 Mar 2023 10:18:03 AM EDT.
Package epel-release-8-13.el8.noarch is already installed.
Dependencies resolved.
==============================================================================================================================================================
Package Architecture Version Repository Size
==============================================================================================================================================================
Upgrading:
epel-release noarch 8-18.el8 extras 24 k

Transaction Summary
==============================================================================================================================================================
Upgrade 1 Package

Total download size: 24 k
Is this ok [y/N]: y
Downloading Packages:
epel-release-8-18.el8.noarch.rpm 4.3 kB/s | 24 kB 00:05
--------------------------------------------------------------------------------------------------------------------------------------------------------------
Total 2.1 kB/s | 24 kB 00:11
Running transaction check
Transaction check succeeded.
Running transaction test
Transaction test succeeded.
Running transaction
Preparing : 1/1
Running scriptlet: epel-release-8-18.el8.noarch 1/1
Upgrading : epel-release-8-18.el8.noarch 1/2
Running scriptlet: epel-release-8-18.el8.noarch 1/2
Cleanup : epel-release-8-13.el8.noarch 2/2
warning: file /etc/yum.repos.d/epel-playground.repo: remove failed: No such file or directory

Running scriptlet: epel-release-8-13.el8.noarch 2/2
Verifying : epel-release-8-18.el8.noarch 1/2
Verifying : epel-release-8-13.el8.noarch 2/2

Upgraded:
epel-release-8-18.el8.noarch

Complete!
[sysadminxpert@RockyLinux ~]$

Step 2: Verify the EPEL repository installation

After installing the EPEL repository configuration package, you can verify the installation by running the following command:

sudo yum repolist

How to Install EPEL Repository on RHEL or Rocky or AlmaLinux

Sample output:

[sysadminxpert@RockyLinux ~]$ sudo yum repolist
repo id repo name
appstream Rocky Linux 8 - AppStream
baseos Rocky Linux 8 - BaseOS
docker-ce-stable Docker CE Stable - x86_64
epel Extra Packages for Enterprise Linux 8 - x86_64
extras Rocky Linux 8 - Extras
powertools Rocky Linux 8 - PowerTools
[sysadminxpert@RockyLinux ~]$

This command will display a list of all the repositories enabled on your system, including the EPEL repository.

Method 2: Installing EPEL using the DNF package manager

DNF (Dandified Yum) is a next-generation package manager that is used to install, update, and remove packages in RHEL and its derivatives. To install EPEL using the DNF package manager, follow these steps:

Step 1: Install the EPEL repository configuration package

To install the EPEL repository, first, we need to download and install the EPEL repository configuration package. Run the following command to download and install the EPEL repository configuration package:

sudo dnf install epel-release

Step 2: Verify the EPEL repository installation

After installing the EPEL repository configuration package, you can verify the installation by running the following command:

sudo dnf repolist

This command will display a list of all the repositories enabled on your system, including the EPEL repository.

Conclusion

In this blog, we discussed how to install the EPEL repository on RHEL and its derivatives such as Rocky and AlmaLinux. The EPEL repository provides additional software packages that are not available in the default repositories, making it a valuable resource for system administrators and developers. We covered two methods for installing the EPEL repository, using the Yum and DNF package managers. Both methods are straightforward and can be completed quickly, so choose the one that suits your needs and preferences. We hope that this guide has been helpful, and you can now install the EPEL repository on your RHEL system with ease.

See also:

Install EPEL Repository on CentOS or Amazon Linux

Download EPEL Repo

List of monitoring tools 

Linux Blogs

AWS Cloud Blogs

Database Blogs

DevOps Blogs

Interview Questions & Answers

Docker Blogs

Google Cloud Blogs