How to Install EPEL Repository on RHEL 9 / RHEL 8

In this article, we will demonstrate how to install epel repository on RHEL 9 and RHEL 8 system.

EPEL Stands for Extra Packages for Enterprise Linux, it is a free and open-source additional packages repository available for RHEL, CentOS Stream, AlmaLinux and Rocky Linux servers. As the name suggests, EPEL repository provides extra and additional packages which are not available in the default package repositories of RHEL 9 and RHEL 8.

Prerequisites

  • Minimal Installed RHEL 9 and RHEL 8 System
  • Root or sudo user with admin privileges
  • Red Hat Subscription
  • Internet Connection

Installing EPEL Repository on RHEL 9

Login to your RHEL 9 system and open terminal and run following commands,

$ sudo subscription-manager repos --enable codeready-builder-for-rhel-9-$(arch)-rpms
$ sudo dnf install -y https://dl.fedoraproject.org/pub/epel/epel-release-latest-9.noarch.rpm

Output of above commands would be something like below,

Install-epel-codeready-repo-rhel9

Once epel rpm package is installed successfully then it will automatically enable and configure its yum / dnf repository.  Run following dnf command to verify whether EPEL repository is enabled or not,

$ sudo dnf repolist epel
Or
$ sudo dnf repolist epel -v

Verify-EPEL-Repo-RHEL9

Installing EPEL Repository on RHEL 8 System

Login or ssh to to your RHEL 8 system and execute following dnf command to install EPEL repository.

$ sudo subscription-manager repos --enable codeready-builder-for-rhel-8-$(arch)-rpms
$ sudo dnf install -y https://dl.fedoraproject.org/pub/epel/epel-release-latest-8.noarch.rpm

Execute the following commands to verify the status of epel repository on RHEL 8 system,

$ sudo dnf repolist epel
$ dnf repolist epel -v

Above commands output will confirm that we have successfully enabled epel repo.

Let’s perform some basic operations on EPEL repo.

List all Available Packages from EPEL Repository

If you want to list all the packages from epel repository then run the following dnf command,

$ sudo dnf repository-packages epel list

Searching a package from EPEL Repository

Let’s assume if we want to search Zabbix package in epel repository, execute the following dnf command,

$ sudo dnf repository-packages epel list | grep -i zabbix

Output,

Search-Package-EPEL-Repo-RHEL

Installing Package from Repository

Let’s assume we want to install neofetch package from epel repository, run following dnf command,

Syntax:

$ dnf –enablerepo=”epel” install <pkg_name>

$ sudo dnf --enablerepo="epel" install neofetch -y

Output,

Neofetch-Package-EPEL-RHEL

Note: If we don’t specify the “–enablerepo=epel” in above command then it will look for neoftech package in all available package repositories.

To verify the package installation, run neofetch command

$ neofetch

We should get the following output,

Neofetch-Command-Output-RHEL-System

That’s all from this article, I hope above steps help you to install EPEL repository on RHEL 9 and RHEL 8 system. Please don’t hesitate to share your queries and feedback in below comments section.

1 thought on “How to Install EPEL Repository on RHEL 9 / RHEL 8”

Leave a Comment