{"id":29678,"date":"2026-12-06T22:06:14","date_gmt":"2026-12-06T22:06:14","guid":{"rendered":"https:\/\/www.devopsschool.com\/blog\/?p=29678"},"modified":"2026-12-06T22:06:14","modified_gmt":"2026-12-06T22:06:14","slug":"how-to-enable-epel-repository-in-redhat-centos","status":"publish","type":"post","link":"https:\/\/www.devopsschool.com\/blog\/how-to-enable-epel-repository-in-redhat-centos\/","title":{"rendered":"Linux Tutorials: How to enable EPEL repository in redhat\/Centos?"},"content":{"rendered":"\n<p class=\"wp-block-paragraph\">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 <code>epel-release<\/code> 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.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">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).<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">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.<\/p>\n\n\n\n<hr class=\"wp-block-separator\"\/>\n\n\n<pre class=\"wp-block-code\" aria-describedby=\"shcb-language-1\" data-shcb-language-name=\"JavaScript\" data-shcb-language-slug=\"javascript\"><span><code class=\"hljs language-javascript\">RHEL <span class=\"hljs-number\">7<\/span>\n\n$ subscription-manager repos --enable rhel-*-optional-rpms \\\n                           --enable rhel-*-extras-rpms \\\n                           --enable rhel-ha-<span class=\"hljs-keyword\">for<\/span>-rhel-*-server-rpms\n$ yum install https:<span class=\"hljs-comment\">\/\/dl.fedoraproject.org\/pub\/epel\/epel-release-latest-7.noarch.rpm<\/span>\n\nCentOS <span class=\"hljs-number\">7<\/span>\n\n$ yum install epel-release\n\nRHEL <span class=\"hljs-number\">8<\/span>\n\n$ subscription-manager repos --enable codeready-builder-<span class=\"hljs-keyword\">for<\/span>-rhel<span class=\"hljs-number\">-8<\/span>-$(arch)-rpms\n$ dnf install https:<span class=\"hljs-comment\">\/\/dl.fedoraproject.org\/pub\/epel\/epel-release-latest-8.noarch.rpm<\/span>\n\nCentOS Linux <span class=\"hljs-number\">8<\/span>, AlmaLinux <span class=\"hljs-number\">8<\/span>, Rocky Linux <span class=\"hljs-number\">8<\/span>\n\n$ dnf config-manager --<span class=\"hljs-keyword\">set<\/span>-enabled powertools\n$ dnf install epel-release<\/code><\/span><small class=\"shcb-language\" id=\"shcb-language-1\"><span class=\"shcb-language__label\">Code language:<\/span> <span class=\"shcb-language__name\">JavaScript<\/span> <span class=\"shcb-language__paren\">(<\/span><span class=\"shcb-language__slug\">javascript<\/span><span class=\"shcb-language__paren\">)<\/span><\/small><\/pre>\n\n\n<hr class=\"wp-block-separator has-alpha-channel-opacity\"\/>\n\n\n\n<h2 class=\"wp-block-heading\">What installing epel-release actually does<\/h2>\n\n\n\n<p class=\"wp-block-paragraph\"><code>epel-release<\/code> is a small package. It installs repository files under <code>\/etc\/yum.repos.d\/<\/code>, usually <code>epel.repo<\/code> plus a disabled <code>epel-testing.repo<\/code>, and the EPEL signing key under <code>\/etc\/pki\/rpm-gpg\/<\/code>. After that, <code>yum<\/code> or <code>dnf<\/code> pulls EPEL metadata from the Fedora mirror network the same way it does for any other repository.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">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 <code>codeready-builder-for-rhel-N-ARCH-rpms<\/code>. On EL 8 rebuilds it is called <code>powertools<\/code>, and on EL 9 and later rebuilds it is called <code>crb<\/code>. 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.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">Commands for every current release<\/h2>\n\n\n\n<p class=\"wp-block-paragraph\">Run all of these as root or with <code>sudo<\/code>. 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.<\/p>\n\n\n\n<figure class=\"wp-block-table\"><table><thead><tr><th>Distribution<\/th><th>Enable the dependency repo<\/th><th>Install EPEL<\/th><\/tr><\/thead><tbody><tr><td>RHEL 8<\/td><td><code>subscription-manager repos --enable codeready-builder-for-rhel-8-$(arch)-rpms<\/code><\/td><td><code>dnf install https:\/\/dl.fedoraproject.org\/pub\/epel\/epel-release-latest-8.noarch.rpm<\/code><\/td><\/tr><tr><td>RHEL 9<\/td><td><code>subscription-manager repos --enable codeready-builder-for-rhel-9-$(arch)-rpms<\/code><\/td><td><code>dnf install https:\/\/dl.fedoraproject.org\/pub\/epel\/epel-release-latest-9.noarch.rpm<\/code><\/td><\/tr><tr><td>RHEL 10<\/td><td><code>subscription-manager repos --enable codeready-builder-for-rhel-10-$(arch)-rpms<\/code><\/td><td><code>dnf install https:\/\/dl.fedoraproject.org\/pub\/epel\/epel-release-latest-10.noarch.rpm<\/code><\/td><\/tr><tr><td>Rocky Linux \/ AlmaLinux 8<\/td><td><code>dnf config-manager --set-enabled powertools<\/code><\/td><td><code>dnf install epel-release<\/code><\/td><\/tr><tr><td>Rocky Linux \/ AlmaLinux 9 and 10<\/td><td><code>dnf config-manager --set-enabled crb<\/code><\/td><td><code>dnf install epel-release<\/code><\/td><\/tr><tr><td>CentOS Stream 9<\/td><td><code>dnf config-manager --set-enabled crb<\/code><\/td><td><code>dnf install epel-release epel-next-release<\/code><\/td><\/tr><\/tbody><\/table><\/figure>\n\n\n\n<p class=\"wp-block-paragraph\"><strong>Note:<\/strong> On RHEL, <code>dnf install epel-release<\/code> fails with &quot;No match for argument&quot; 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 <code>epel-release<\/code> in their extras repository. Oracle Linux has its own packages, such as <code>oracle-epel-release-el8<\/code> and <code>oracle-epel-release-el9<\/code>, which point at Oracle&#039;s EPEL mirror.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\"><code>dnf config-manager<\/code> comes from the <code>dnf-plugins-core<\/code> package. Minimal images often don&#039;t include it, so install it first:<\/p>\n\n\n<pre class=\"wp-block-code\" aria-describedby=\"shcb-language-2\" data-shcb-language-name=\"JavaScript\" data-shcb-language-slug=\"javascript\"><span><code class=\"hljs language-javascript\">sudo dnf install -y dnf-plugins-core\nsudo dnf config-manager --<span class=\"hljs-keyword\">set<\/span>-enabled crb   # use powertools on EL 8\nsudo dnf install -y epel-release<\/code><\/span><small class=\"shcb-language\" id=\"shcb-language-2\"><span class=\"shcb-language__label\">Code language:<\/span> <span class=\"shcb-language__name\">JavaScript<\/span> <span class=\"shcb-language__paren\">(<\/span><span class=\"shcb-language__slug\">javascript<\/span><span class=\"shcb-language__paren\">)<\/span><\/small><\/pre>\n\n\n<h2 class=\"wp-block-heading\">Corrections and updates to the example above<\/h2>\n\n\n\n<ul class=\"wp-block-list\">\n<li><strong>Run the commands as root.<\/strong> The <code>$<\/code> prompt in the example suggests a normal user, but <code>subscription-manager<\/code>, <code>yum<\/code> and <code>dnf<\/code> all need root. Put <code>sudo<\/code> in front of each command or run them from a root shell.<\/li>\n\n\n<li><strong>RHEL 7 and CentOS 7 are end of life.<\/strong> 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.<\/li>\n\n\n<li><strong>RHEL 7 HA repository.<\/strong> <code>rhel-ha-for-rhel-*-server-rpms<\/code> works only if the system has a High Availability add-on entitlement. Without one, the command reports an error for that repo. Remove that <code>--enable<\/code> flag if you don&#039;t need HA packages.<\/li>\n\n\n<li><strong>CentOS Linux 8 is end of life.<\/strong> It stopped receiving updates on 31 December 2021 and its mirrors were moved to the vault, so <code>dnf install epel-release<\/code> usually fails with metadata download errors. Migrate to Rocky Linux, AlmaLinux, CentOS Stream or RHEL.<\/li>\n\n\n<li><strong>PowerTools capitalisation.<\/strong> On early EL 8 point releases the repo ID was <code>PowerTools<\/code>. Later releases use <code>powertools<\/code>. Run <code>dnf repolist all | grep -i powertools<\/code> to see the exact ID on your system.<\/li>\n\n\n<li><strong>EL 9 and later are missing from the example.<\/strong> On these releases PowerTools was renamed to <code>crb<\/code>. The table above gives the commands.<\/li>\n<\/ul>\n\n\n\n<h2 class=\"wp-block-heading\">Verify that EPEL is enabled<\/h2>\n\n\n\n<ol class=\"wp-block-list\">\n<li>Confirm the release package is installed: <code>rpm -q epel-release<\/code>.<\/li>\n\n\n<li>List the enabled repositories and look for <code>epel<\/code> (and <code>crb<\/code>, <code>powertools<\/code> or <code>codeready-builder<\/code>) in the output.<\/li>\n\n\n<li>Install a package that only EPEL provides, such as <code>htop<\/code>. The first time you install from EPEL, dnf asks you to import the EPEL GPG key. Check the fingerprint and answer <code>y<\/code>.<\/li>\n<\/ol>\n\n\n<pre class=\"wp-block-code\"><span><code class=\"hljs\">$ rpm -q epel-release\nepel-release-9-x.el9.noarch\n\n$ dnf repolist\nrepo id        repo name\nappstream      Rocky Linux 9 - AppStream\nbaseos         Rocky Linux 9 - BaseOS\ncrb            Rocky Linux 9 - CRB\nepel           Extra Packages for Enterprise Linux 9 - x86_64\nextras         Rocky Linux 9 - Extras\n\n$ sudo dnf install -y htop\n$ dnf info htop | grep -i repo\nRepository   : epel<\/code><\/span><\/pre>\n\n\n<p class=\"wp-block-paragraph\">Your version strings and repo names will differ. What matters is that <code>epel<\/code> appears in the list and that <code>dnf info<\/code> reports packages from it. To see everything EPEL offers, run <code>dnf --disablerepo=&#039;*&#039; --enablerepo=epel list available<\/code>.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">Automate it across EL 8 and newer<\/h2>\n\n\n\n<p class=\"wp-block-paragraph\">If you build images or provision a mixed fleet, read <code>\/etc\/os-release<\/code> and pick the right commands automatically. The script below assumes the RHEL hosts are already registered with <code>subscription-manager<\/code>.<\/p>\n\n\n<pre class=\"wp-block-code\" aria-describedby=\"shcb-language-3\" data-shcb-language-name=\"PHP\" data-shcb-language-slug=\"php\"><span><code class=\"hljs language-php\"><span class=\"hljs-comment\">#!\/usr\/bin\/env bash<\/span>\nset -euo pipefail\n. \/etc\/os-release\nmajor=<span class=\"hljs-string\">\"${VERSION_ID%%.*}\"<\/span>\n\n<span class=\"hljs-keyword\">case<\/span> <span class=\"hljs-string\">\"$ID\"<\/span> in\n  rhel)\n    sudo subscription-manager repos --enable <span class=\"hljs-string\">\"codeready-builder-for-rhel-${major}-$(arch)-rpms\"<\/span>\n    sudo dnf install -y <span class=\"hljs-string\">\"https:\/\/dl.fedoraproject.org\/pub\/epel\/epel-release-latest-${major}.noarch.rpm\"<\/span>\n    ;;\n  rocky|almalinux|centos)\n    sudo dnf install -y dnf-plugins-core\n    <span class=\"hljs-keyword\">if<\/span> &#91; <span class=\"hljs-string\">\"$major\"<\/span> = <span class=\"hljs-string\">\"8\"<\/span> ]; then\n      sudo dnf config-manager --set-enabled powertools\n    <span class=\"hljs-keyword\">else<\/span>\n      sudo dnf config-manager --set-enabled crb\n    fi\n    sudo dnf install -y epel-release\n    ;;\n  *)\n    <span class=\"hljs-keyword\">echo<\/span> <span class=\"hljs-string\">\"Unsupported distribution: $ID $VERSION_ID\"<\/span> &gt;&amp;<span class=\"hljs-number\">2<\/span>\n    <span class=\"hljs-keyword\">exit<\/span> <span class=\"hljs-number\">1<\/span>\n    ;;\nesac\n\ndnf repolist | grep -E <span class=\"hljs-string\">'^epel'<\/span><\/code><\/span><small class=\"shcb-language\" id=\"shcb-language-3\"><span class=\"shcb-language__label\">Code language:<\/span> <span class=\"shcb-language__name\">PHP<\/span> <span class=\"shcb-language__paren\">(<\/span><span class=\"shcb-language__slug\">php<\/span><span class=\"shcb-language__paren\">)<\/span><\/small><\/pre>\n\n\n<p class=\"wp-block-paragraph\"><code>${VERSION_ID%%.*}<\/code> cuts a value like <code>9.4<\/code> down to the major version <code>9<\/code>. That number is used both in the CodeReady Builder repo name and in the <code>epel-release-latest-N<\/code> URL. The last line exits with a non-zero status if <code>epel<\/code> is not listed, which makes the script safe to use in CI pipelines and image builds.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">Common errors and fixes<\/h2>\n\n\n\n<figure class=\"wp-block-table\"><table><thead><tr><th>Error<\/th><th>Cause<\/th><th>Fix<\/th><\/tr><\/thead><tbody><tr><td><code>No such command: config-manager<\/code><\/td><td><code>dnf-plugins-core<\/code> is not installed<\/td><td><code>sudo dnf install dnf-plugins-core<\/code><\/td><\/tr><tr><td><code>Error: No matching repo to modify: powertools<\/code><\/td><td>You are on EL 9 or later, or on an early EL 8 release that uses <code>PowerTools<\/code><\/td><td>Use <code>crb<\/code> on EL 9 and later. Check the exact ID with <code>dnf repolist all<\/code><\/td><\/tr><tr><td><code>This system is not registered with an entitlement server<\/code><\/td><td>The RHEL host is not registered<\/td><td><code>sudo subscription-manager register<\/code>, then run the repo commands again<\/td><\/tr><tr><td><code>nothing provides libXYZ needed by package-from-epel<\/code><\/td><td>CodeReady Builder, CRB or PowerTools is not enabled<\/td><td>Enable the dependency repo for your release<\/td><\/tr><tr><td><code>Failed to download metadata for repo &#039;appstream&#039;<\/code> on CentOS 8<\/td><td>CentOS Linux 8 is end of life and its mirrors are gone<\/td><td>Migrate to a supported EL 8-compatible distribution<\/td><\/tr><tr><td><code>GPG check FAILED<\/code><\/td><td>The EPEL key was not imported or the wrong major-version key is in use<\/td><td><code>sudo rpm --import \/etc\/pki\/rpm-gpg\/RPM-GPG-KEY-EPEL-$(rpm -E %rhel)<\/code><\/td><\/tr><\/tbody><\/table><\/figure>\n\n\n\n<h2 class=\"wp-block-heading\">Disable, limit or remove EPEL<\/h2>\n\n\n\n<p class=\"wp-block-paragraph\">Some teams keep EPEL disabled by default so that a routine <code>dnf update<\/code> never pulls in community packages without someone noticing. You can still install from it when you need to:<\/p>\n\n\n<pre class=\"wp-block-code\" aria-describedby=\"shcb-language-4\" data-shcb-language-name=\"PHP\" data-shcb-language-slug=\"php\"><span><code class=\"hljs language-php\"><span class=\"hljs-comment\"># Disable EPEL permanently, but keep it configured<\/span>\nsudo dnf config-manager --set-disabled epel\n\n<span class=\"hljs-comment\"># Use it for a single transaction only<\/span>\nsudo dnf --enablerepo=epel install htop\n\n<span class=\"hljs-comment\"># Remove the repo definition entirely<\/span>\n<span class=\"hljs-comment\"># (packages already installed from EPEL stay installed)<\/span>\nsudo dnf remove epel-release<\/code><\/span><small class=\"shcb-language\" id=\"shcb-language-4\"><span class=\"shcb-language__label\">Code language:<\/span> <span class=\"shcb-language__name\">PHP<\/span> <span class=\"shcb-language__paren\">(<\/span><span class=\"shcb-language__slug\">php<\/span><span class=\"shcb-language__paren\">)<\/span><\/small><\/pre>\n\n\n<ul class=\"wp-block-list\">\n<li>Leave <code>gpgcheck=1<\/code> in <code>\/etc\/yum.repos.d\/epel.repo<\/code>. Never turn off signature checking to work around an error.<\/li>\n\n\n<li>Keep <code>epel-testing<\/code> disabled on production hosts. It holds packages that have not passed the normal update testing period yet.<\/li>\n\n\n<li>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.<\/li>\n\n\n<li>In air-gapped environments, mirror EPEL into Satellite, Pulp or a local <code>reposync<\/code> mirror instead of letting every host reach the internet.<\/li>\n<\/ul>\n\n\n\n<h2 class=\"wp-block-heading\">Frequently asked questions<\/h2>\n\n\n\n<h3 class=\"wp-block-heading\">Is it safe to enable EPEL on a production RHEL server?<\/h3>\n\n\n\n<p class=\"wp-block-paragraph\">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.<\/p>\n\n\n\n<h3 class=\"wp-block-heading\">Why does dnf install epel-release fail on RHEL but work on Rocky Linux?<\/h3>\n\n\n\n<p class=\"wp-block-paragraph\">Red Hat does not ship the <code>epel-release<\/code> package in its repositories, so on RHEL you install it from the Fedora URL (<code>epel-release-latest-N.noarch.rpm<\/code>). Rocky Linux, AlmaLinux and CentOS Stream include it in their extras repository.<\/p>\n\n\n\n<h3 class=\"wp-block-heading\">What is the difference between CRB, PowerTools and CodeReady Builder?<\/h3>\n\n\n\n<p class=\"wp-block-paragraph\">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.<\/p>\n\n\n\n<h3 class=\"wp-block-heading\">Can I still use EPEL on CentOS 7?<\/h3>\n\n\n\n<p class=\"wp-block-paragraph\">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.<\/p>\n\n\n\n<h3 class=\"wp-block-heading\">How do I check which repository a package came from?<\/h3>\n\n\n\n<p class=\"wp-block-paragraph\">Run <code>dnf info &lt;package&gt;<\/code> and look at the <code>Repository<\/code> field for available packages or <code>From repo<\/code> for installed ones. <code>dnf list installed | grep epel<\/code> lists everything installed from EPEL.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">Related tutorials<\/h2>\n\n\n\n<ul class=\"wp-block-list\">\n<li><a href=\"https:\/\/www.devopsschool.com\/blog\/category\/operating-systems\/linux\/\">More Linux tutorials<\/a><\/li>\n\n\n<li><a href=\"https:\/\/www.devopsschool.com\/blog\/red-hat-ex342-complete-home-study-curriculum\/\">Red Hat EX342 Complete Home-Study Curriculum<\/a><\/li>\n\n\n<li><a href=\"https:\/\/www.devopsschool.com\/blog\/how-to-login-to-linux-server-using-putty\/\">How to Login to Linux Server using Putty?<\/a><\/li>\n<\/ul>\n","protected":false},"excerpt":{"rendered":"<p>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&#8230; <\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"_joinchat":[],"footnotes":""},"categories":[4957],"tags":[535,26211,26305],"class_list":["post-29678","post","type-post","status-publish","format-standard","hentry","category-linux","tag-centos","tag-linux-package-management","tag-red-hat-enterprise-linux"],"_links":{"self":[{"href":"https:\/\/www.devopsschool.com\/blog\/wp-json\/wp\/v2\/posts\/29678","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.devopsschool.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.devopsschool.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.devopsschool.com\/blog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.devopsschool.com\/blog\/wp-json\/wp\/v2\/comments?post=29678"}],"version-history":[{"count":3,"href":"https:\/\/www.devopsschool.com\/blog\/wp-json\/wp\/v2\/posts\/29678\/revisions"}],"predecessor-version":[{"id":80721,"href":"https:\/\/www.devopsschool.com\/blog\/wp-json\/wp\/v2\/posts\/29678\/revisions\/80721"}],"wp:attachment":[{"href":"https:\/\/www.devopsschool.com\/blog\/wp-json\/wp\/v2\/media?parent=29678"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.devopsschool.com\/blog\/wp-json\/wp\/v2\/categories?post=29678"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.devopsschool.com\/blog\/wp-json\/wp\/v2\/tags?post=29678"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}