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.
| Distribution | Enable the dependency repo | Install EPEL |
|---|---|---|
| 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 |
| RHEL 9 | subscription-manager repos --enable codeready-builder-for-rhel-9-$(arch)-rpms | dnf install https://dl.fedoraproject.org/pub/epel/epel-release-latest-9.noarch.rpm |
| RHEL 10 | subscription-manager repos --enable codeready-builder-for-rhel-10-$(arch)-rpms | dnf install https://dl.fedoraproject.org/pub/epel/epel-release-latest-10.noarch.rpm |
| Rocky Linux / AlmaLinux 8 | dnf config-manager --set-enabled powertools | dnf install epel-release |
| Rocky Linux / AlmaLinux 9 and 10 | dnf config-manager --set-enabled crb | dnf install epel-release |
| CentOS Stream 9 | dnf config-manager --set-enabled crb | dnf 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, butsubscription-manager,yumanddnfall need root. Putsudoin 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-rpmsworks only if the system has a High Availability add-on entitlement. Without one, the command reports an error for that repo. Remove that--enableflag 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-releaseusually 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 usepowertools. Rundnf repolist all | grep -i powertoolsto 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
- Confirm the release package is installed:
rpm -q epel-release. - List the enabled repositories and look for
epel(andcrb,powertoolsorcodeready-builder) in the output. - 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 answery.
$ 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
| Error | Cause | Fix |
|---|---|---|
No such command: config-manager | dnf-plugins-core is not installed | sudo dnf install dnf-plugins-core |
Error: No matching repo to modify: powertools | You are on EL 9 or later, or on an early EL 8 release that uses PowerTools | Use crb on EL 9 and later. Check the exact ID with dnf repolist all |
This system is not registered with an entitlement server | The RHEL host is not registered | sudo subscription-manager register, then run the repo commands again |
nothing provides libXYZ needed by package-from-epel | CodeReady Builder, CRB or PowerTools is not enabled | Enable the dependency repo for your release |
Failed to download metadata for repo 'appstream' on CentOS 8 | CentOS Linux 8 is end of life and its mirrors are gone | Migrate to a supported EL 8-compatible distribution |
GPG check FAILED | The EPEL key was not imported or the wrong major-version key is in use | sudo 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=1in/etc/yum.repos.d/epel.repo. Never turn off signature checking to work around an error. - Keep
epel-testingdisabled 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
reposyncmirror 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
- More Linux tutorials
- Red Hat EX342 Complete Home-Study Curriculum
- How to Login to Linux Server using Putty?
I’m Rajesh Kumar, a DevOps, SRE, DevSecOps, Cloud, and Platform Engineering expert passionate about sharing practical knowledge, real-world experiences, and industry best practices. I have worked at Cotocus and regularly write about technology, travel, investing, health, product reviews, and digital marketing through my various platforms.
I publish technical articles at DevOps School, travel stories at Holiday Landmark, stock market insights at Stocks Mantra, health and fitness guidance at My Medic Plus, product reviews at TrueReviewNow, and SEO and digital marketing strategies at Wizbrand.
Find Trusted Cardiac Hospitals
Compare heart hospitals by city and services โ all in one place.
Explore Hospitals