How to Install EPEL Repository on RHEL 9

EPEL (Extra Packages for Enterprise Linux) is an essential repository for RHEL and its derivatives that provides a vast collection of additional software packages. Follow this guide to enable EPEL on your RHEL 9 based system. ✨

Prerequisites

Before proceeding, make sure your system is up to date:

sudo dnf upgrade --refresh

Step 1: Enable the CRB repository

The CRB (CodeReady Builder) repository is required for EPEL installation on RHEL 9. Enable it with the following command:

sudo dnf config-manager --set-enabled crb

Step 2: Install EPEL and EPEL Next

Install both EPEL and EPEL Next repositories using the dnf package manager:


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

➡️ If you don’t need the EPEL Next repository, simply remove the second URL from the command.

Step 3: Verify EPEL Installation

Confirm that EPEL has been successfully installed by running:

dnf repolist | grep epel

You should see the EPEL repositories listed in the output. 📋

Using EPEL Repository

Here are some useful commands for working with the EPEL repository:

  • List all packages available in EPEL:
    dnf list available --enablerepo=epel
  • Search for a specific package in EPEL:
    dnf search package-name --enablerepo=epel
  • Install a package from EPEL:
    dnf install package-name --enablerepo=epel
  • Check for updates on packages installed from EPEL:
    dnf check-update --enablerepo=epel

Removing EPEL (Optional)

If you need to remove the EPEL repository, use the following commands:

  • Remove EPEL repository:
    sudo dnf remove epel-release
  • Remove EPEL Next repository:
    sudo dnf remove epel-next-release

🎉 Congratulations! You have successfully installed and configured the EPEL repository on your RHEL 9 based system. Enjoy access to a wide range of additional software packages! 🚀

Scroll to Top