โ˜• XOPSSCHOOL โ€” LEARNING MADE AFFORDABLE
Build the Skills Your Next Career Move Demands.
For the Price of One Coffee a Month.
Why spend hundreds on individual courses? Unlock an entire year of technical learning with one Coffee Pass.
US$4.90 /month
US$58.80/year
โ‚น499 + GST/month
โ‚น5,988 + GST/year
โ‚ฌ4.90 /month
โ‚ฌ58.80/year
12 Months of Access • Billed Annually • No Automatic Renewal
DevOps • Cloud • SRE • Kubernetes • Terraform • DevSecOps • AI • AIOps • MLOps • LLMOps • FinOps • GitOps • Platform Engineering & Much More
192
Premium Courses
1,085
Video Sessions
99
Ops Disciplines
86
Tool Courses
340
Assignments
227
Quizzes
โœ“ QR-Verifiable Certificates   โœ“ Learn at Your Own Pace   โœ“ Hands-on Learning   โœ“ New Courses Included
Learn from real-world, instructor-led video sessions by
Rajesh Kumar
Principal Architect • Trainer • Mentor • 15+ Years of Industry Experience
โ˜• Get My Coffee Pass โ€” Start Learning Today →
One Payment. Every Premium Course. One Full Year.
The best investment you can make is in the person you are becoming.

Linux Tutorials: How to enable EPEL repository in redhat/Centos?

To enable EPEL (Extra Packages for Enterprise Linux), you first turn on the repository it depends on, which is CodeReady Builder on RHEL, PowerTools on EL 8 rebuilds, or CRB on EL 9 and later. Then you install the epel-release package, which adds the EPEL repo definition and its GPG key. The commands above cover RHEL/CentOS 7 and 8. Below you will find the commands for RHEL 9 and 10, Rocky Linux and AlmaLinux, plus how to check that EPEL works, how to fix common errors, and how to disable or remove it.

Extra Packages for Enterprise Linux (or EPEL) is a Fedora Special Interest Group that creates, maintains, and manages a high quality set of additional packages for Enterprise Linux, including, but not limited to, Red Hat Enterprise Linux (RHEL), CentOS, Scientific Linux (SL), Oracle Linux (OL), AlmaLinux (AL) and Rocky Linux (RL).

EPEL packages are usually based on their Fedora counterparts and will never conflict with or replace packages in the base Enterprise Linux distributions. EPEL uses much of the same infrastructure as Fedora, including buildsystem, Bugzilla instance, updates manager, mirror manager and more.


RHEL 7

$ subscription-manager repos --enable rhel-*-optional-rpms \
                           --enable rhel-*-extras-rpms \
                           --enable rhel-ha-for-rhel-*-server-rpms
$ yum install https://dl.fedoraproject.org/pub/epel/epel-release-latest-7.noarch.rpm

CentOS 7

$ yum install epel-release

RHEL 8

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

CentOS Linux 8, AlmaLinux 8, Rocky Linux 8

$ dnf config-manager --set-enabled powertools
$ dnf install epel-releaseCode language: JavaScript (javascript)

What installing epel-release actually does

epel-release is a small package. It installs repository files under /etc/yum.repos.d/, usually epel.repo plus a disabled epel-testing.repo, and the EPEL signing key under /etc/pki/rpm-gpg/. After that, yum or dnf pulls EPEL metadata from the Fedora mirror network the same way it does for any other repository.

Many EPEL packages are built against libraries that ship in the CodeReady Builder (CRB) repository, not in BaseOS or AppStream. On RHEL that repository is called codeready-builder-for-rhel-N-ARCH-rpms. On EL 8 rebuilds it is called powertools, and on EL 9 and later rebuilds it is called crb. If you skip enabling it, the EPEL repo itself works, but some installs fail with unresolved dependencies. That is why every command block above enables an extra repository first.

Commands for every current release

Run all of these as root or with sudo. The original only covers releases 7 and 8. Releases 7 and CentOS Linux 8 are now end of life (see the next section). This table adds the releases you are most likely to be running today.

DistributionEnable the dependency repoInstall EPEL
RHEL 8subscription-manager repos --enable codeready-builder-for-rhel-8-$(arch)-rpmsdnf install https://dl.fedoraproject.org/pub/epel/epel-release-latest-8.noarch.rpm
RHEL 9subscription-manager repos --enable codeready-builder-for-rhel-9-$(arch)-rpmsdnf install https://dl.fedoraproject.org/pub/epel/epel-release-latest-9.noarch.rpm
RHEL 10subscription-manager repos --enable codeready-builder-for-rhel-10-$(arch)-rpmsdnf install https://dl.fedoraproject.org/pub/epel/epel-release-latest-10.noarch.rpm
Rocky Linux / AlmaLinux 8dnf config-manager --set-enabled powertoolsdnf install epel-release
Rocky Linux / AlmaLinux 9 and 10dnf config-manager --set-enabled crbdnf install epel-release
CentOS Stream 9dnf config-manager --set-enabled crbdnf install epel-release epel-next-release

Note: On RHEL, dnf install epel-release fails with "No match for argument" because Red Hat does not ship that package. Install it from the Fedora URL as the table shows. Rocky Linux, AlmaLinux and CentOS Stream do carry epel-release in their extras repository. Oracle Linux has its own packages, such as oracle-epel-release-el8 and oracle-epel-release-el9, which point at Oracle's EPEL mirror.

dnf config-manager comes from the dnf-plugins-core package. Minimal images often don't include it, so install it first:

sudo dnf install -y dnf-plugins-core
sudo dnf config-manager --set-enabled crb   # use powertools on EL 8
sudo dnf install -y epel-releaseCode language: JavaScript (javascript)

Corrections and updates to the example above

  • Run the commands as root. The $ prompt in the example suggests a normal user, but subscription-manager, yum and dnf all need root. Put sudo in front of each command or run them from a root shell.
  • RHEL 7 and CentOS 7 are end of life. CentOS 7 reached end of life on 30 June 2024, and RHEL 7 left its maintenance phase on the same date. EPEL 7 was retired at that point and its content moved to the Fedora archive, so the regular mirrors no longer serve it. Use these commands only on legacy systems that are covered by extended support, and plan a migration.
  • RHEL 7 HA repository. rhel-ha-for-rhel-*-server-rpms works only if the system has a High Availability add-on entitlement. Without one, the command reports an error for that repo. Remove that --enable flag if you don't need HA packages.
  • CentOS Linux 8 is end of life. It stopped receiving updates on 31 December 2021 and its mirrors were moved to the vault, so dnf install epel-release usually fails with metadata download errors. Migrate to Rocky Linux, AlmaLinux, CentOS Stream or RHEL.
  • PowerTools capitalisation. On early EL 8 point releases the repo ID was PowerTools. Later releases use powertools. Run dnf repolist all | grep -i powertools to see the exact ID on your system.
  • EL 9 and later are missing from the example. On these releases PowerTools was renamed to crb. The table above gives the commands.

Verify that EPEL is enabled

  1. Confirm the release package is installed: rpm -q epel-release.
  2. List the enabled repositories and look for epel (and crb, powertools or codeready-builder) in the output.
  3. Install a package that only EPEL provides, such as htop. The first time you install from EPEL, dnf asks you to import the EPEL GPG key. Check the fingerprint and answer y.
$ rpm -q epel-release
epel-release-9-x.el9.noarch

$ dnf repolist
repo id        repo name
appstream      Rocky Linux 9 - AppStream
baseos         Rocky Linux 9 - BaseOS
crb            Rocky Linux 9 - CRB
epel           Extra Packages for Enterprise Linux 9 - x86_64
extras         Rocky Linux 9 - Extras

$ sudo dnf install -y htop
$ dnf info htop | grep -i repo
Repository   : epel

Your version strings and repo names will differ. What matters is that epel appears in the list and that dnf info reports packages from it. To see everything EPEL offers, run dnf --disablerepo='*' --enablerepo=epel list available.

Automate it across EL 8 and newer

If you build images or provision a mixed fleet, read /etc/os-release and pick the right commands automatically. The script below assumes the RHEL hosts are already registered with subscription-manager.

#!/usr/bin/env bash
set -euo pipefail
. /etc/os-release
major="${VERSION_ID%%.*}"

case "$ID" in
  rhel)
    sudo subscription-manager repos --enable "codeready-builder-for-rhel-${major}-$(arch)-rpms"
    sudo dnf install -y "https://dl.fedoraproject.org/pub/epel/epel-release-latest-${major}.noarch.rpm"
    ;;
  rocky|almalinux|centos)
    sudo dnf install -y dnf-plugins-core
    if [ "$major" = "8" ]; then
      sudo dnf config-manager --set-enabled powertools
    else
      sudo dnf config-manager --set-enabled crb
    fi
    sudo dnf install -y epel-release
    ;;
  *)
    echo "Unsupported distribution: $ID $VERSION_ID" >&2
    exit 1
    ;;
esac

dnf repolist | grep -E '^epel'Code language: PHP (php)

${VERSION_ID%%.*} cuts a value like 9.4 down to the major version 9. That number is used both in the CodeReady Builder repo name and in the epel-release-latest-N URL. The last line exits with a non-zero status if epel is not listed, which makes the script safe to use in CI pipelines and image builds.

Common errors and fixes

ErrorCauseFix
No such command: config-managerdnf-plugins-core is not installedsudo dnf install dnf-plugins-core
Error: No matching repo to modify: powertoolsYou are on EL 9 or later, or on an early EL 8 release that uses PowerToolsUse crb on EL 9 and later. Check the exact ID with dnf repolist all
This system is not registered with an entitlement serverThe RHEL host is not registeredsudo subscription-manager register, then run the repo commands again
nothing provides libXYZ needed by package-from-epelCodeReady Builder, CRB or PowerTools is not enabledEnable the dependency repo for your release
Failed to download metadata for repo 'appstream' on CentOS 8CentOS Linux 8 is end of life and its mirrors are goneMigrate to a supported EL 8-compatible distribution
GPG check FAILEDThe EPEL key was not imported or the wrong major-version key is in usesudo rpm --import /etc/pki/rpm-gpg/RPM-GPG-KEY-EPEL-$(rpm -E %rhel)

Disable, limit or remove EPEL

Some teams keep EPEL disabled by default so that a routine dnf update never pulls in community packages without someone noticing. You can still install from it when you need to:

# Disable EPEL permanently, but keep it configured
sudo dnf config-manager --set-disabled epel

# Use it for a single transaction only
sudo dnf --enablerepo=epel install htop

# Remove the repo definition entirely
# (packages already installed from EPEL stay installed)
sudo dnf remove epel-releaseCode language: PHP (php)
  • Leave gpgcheck=1 in /etc/yum.repos.d/epel.repo. Never turn off signature checking to work around an error.
  • Keep epel-testing disabled on production hosts. It holds packages that have not passed the normal update testing period yet.
  • EPEL is community maintained, and Red Hat does not support it. Packages can be retired between minor releases, so pin or mirror the ones your production systems depend on.
  • In air-gapped environments, mirror EPEL into Satellite, Pulp or a local reposync mirror instead of letting every host reach the internet.

Frequently asked questions

Is it safe to enable EPEL on a production RHEL server?

Generally yes. EPEL policy says its packages must not replace or conflict with packages in the base distribution, and every package is GPG-signed. Red Hat does not support EPEL, though, so many organisations mirror it internally and keep it disabled by default.

Why does dnf install epel-release fail on RHEL but work on Rocky Linux?

Red Hat does not ship the epel-release package in its repositories, so on RHEL you install it from the Fedora URL (epel-release-latest-N.noarch.rpm). Rocky Linux, AlmaLinux and CentOS Stream include it in their extras repository.

What is the difference between CRB, PowerTools and CodeReady Builder?

They are the same repository under different names. RHEL calls it CodeReady Builder. EL 8 rebuilds called it PowerTools, and EL 9 and later rebuilds call it CRB. It holds development libraries and tools that many EPEL packages depend on.

Can I still use EPEL on CentOS 7?

Not from the regular mirrors. EPEL 7 was retired after RHEL 7 left maintenance in mid-2024, and its packages were moved to the Fedora archive. Migrate the system to a supported EL release instead.

How do I check which repository a package came from?

Run dnf info <package> and look at the Repository field for available packages or From repo for installed ones. dnf list installed | grep epel lists everything installed from EPEL.

Related tutorials

Find Trusted Cardiac Hospitals

Compare heart hospitals by city and services โ€” all in one place.

Explore Hospitals

Related Posts

How to install MySql and MaridaDb in Centos/RHEL?

This guide shows how to install MySQL Community Server or MariaDB on CentOS, RHEL and compatible distributions such as Rocky Linux and AlmaLinux, then secure and check…

Read More

How to install Ansible in Centos 7/RHEL 7?

On CentOS 7 or RHEL 7 you can install Ansible in two ways: with yum from the EPEL repository, which gives you Ansible 2.9, or with pip…

Read More

Docker Tutorials: Installation and Configurations

Docker Installation in Centos/RHEL Method -1: How to install Docker Community Edition via YUM? Step 1 – Install required packages. yum-utils provides the yum-config-manager utility, and device-mapper-persistent-data…

Read More

What is yum and use cases of yum?

What is yum? yum, short for Yellowdog Updater Modified, is a command-line package management utility for RPM (Red Hat Package Manager)-based Linux distributions, such as CentOS and…

Read More

How to enable http Proxy Settings for Yum Command on RHEL / CentOS Servers?

No username and password required: To configure proxy without username and password: export http_proxy=http://SERVER:PORT/ Username and password authentication: To configure the proxy server with username and password…

Read More

Puppet Tutorials: Installing and Configure Puppet Server & Agent

This guide installs Puppet Server 7 on RHEL 8 or CentOS 8, installs the Puppet agent on RHEL and Ubuntu nodes, and connects each agent to the…

Read More
Subscribe
Notify of
guest
0 Comments
Newest
Oldest Most Voted
0
Would love your thoughts, please comment.x
()
x