How to install and enable EPEL repository on a CentOS/RHEL 7

How do I install the extra repositories such as Fedora EPEL repo on a Red Hat Enterprise Linux server version 7.x or CentOS Linux server version 7.x?

Tutorial details
Difficulty level Easy
Root privileges Yes
Requirements CentOS/RHEL/Fedora
Est. reading time 5m
You can easily install various packages by configuring a CentOS 7.x or RHEL 7.x system to use Fedora EPEL repos and third party packages. Please note that these packages are not officially supported by either CentOS or Red Hat, but provides many popular packages and apps. This quick tutorial explains how to configure a CentOS or Red Hat Enterprise Linux (RHEL) version 7.x to use the Fedora Extra Packages for Enterprise Linux (EPEL) repository.

What is an EPEL repository (repo)?

The EPEL repository was created by the EPEL group working at the Fedora Project. The EPEL is an acronym for Extra Packages for Enterprise Linux. The EPEL repository used by the following Linux Distributions:

  1. Red Hat Enterprise Linux (RHEL)
  2. CentOS
  3. Oracle Linux

Installing EPEL repository on a CentOS Linux and RHEL 7.x

The procedure to enable EPEL repository for a CentOS/RHEL 7.x server is as follows:

  1. Open a shell prompt.
  2. Or login to a host called server1 using ssh client.
  3. Install epel repository using: yum -y install epel-release
  4. Refresh epel repo by typing: yum repolist
  5. Install packages from epel repo : yum install pkg1

How to install EPEL repo on a CentOS and RHEL 7.x

The following instructions assumes that you are running command as root user on a CentOS/RHEL 7.x system and want to use use Fedora Epel repository.

Method #1: Install Extra Packages for Enterprise Linux repository configuration (recommended)

Just type the following yum command on a CentOS 7 or RHEL 7:
sudo yum install epel-release

Fig.01: How To Install EPEL Repo on a CentOS and RHEL 7.x

Fig.01: Installing epel-release package on a Centos 7

Note: If method #1 failed, try the following method #2 to install EPEL Repo.

Method #2: Install the extra EPEL repositories from

The command is as follows to download epel release for CentOS and RHEL 7.x using wget command:

cd /tmp
ls *.rpm

To install epel-release-7-11.noarch.rpm, type:
sudo yum install epel-release-latest-7.noarch.rpm
Sample outputs:

Loaded plugins: copr
Examining epel-release-latest-7.noarch.rpm: epel-release-7-11.noarch
Marking epel-release-latest-7.noarch.rpm to be installed
Resolving Dependencies
--> Running transaction check
---> Package epel-release.noarch 0:7-11 will be installed
--> Finished Dependency Resolution
Dependencies Resolved
 Package          Arch       Version    Repository                         Size
 epel-release     noarch     7-11       /epel-release-latest-7.noarch      24 k
Transaction Summary
Install  1 Package
Total size: 24 k
Installed size: 24 k
Is this ok [y/d/N]: y
Downloading packages:
Running transaction check
Running transaction test
Transaction test succeeded
Running transaction
  Installing : epel-release-7-11.noarch                                     1/1 
  Verifying  : epel-release-7-11.noarch                                     1/1 
  epel-release.noarch 0:7-11                                                    

List your new repos

Once installed you should see epel repo using the following yum repolist command
$ sudo yum repolist
Sample outputs:

Loaded plugins: amazon-id, rhui-lb
repo id                                         repo name                                         status
epel/x86_64                                     Extra Packages for Enterprise Linux 7 - x86_64    5,610
rhui-REGION-client-config-server-7/x86_64       Red Hat Update Infrastructure 2.0 Client Configur     2
rhui-REGION-rhel-server-releases/7Server/x86_64 Red Hat Enterprise Linux Server 7 (RPMs)          4,718
repolist: 10,330

Search and install package

To list all available packages under a repo called epel, enter:
$ sudo yum --disablerepo="*" --enablerepo="epel" list available
$ sudo yum --disablerepo="*" --enablerepo="epel" list available | grep 'package'
$ sudo yum --disablerepo="*" --enablerepo="epel" list available | less
Sample outputs:

Fig. 02: List all available packages under a EPEL Repo on a CentOS/RHEL/Fedora Linux

Fig. 02: List all available packages under a EPEL Repo on a CentOS/RHEL/Fedora Linux

Example: Search and install htop package from epel repo on a CentOS/RHEL 7.x

The commands are as follows (see yum our command guide for more info):

## search it ##
sudo yum search htop
## get more info, if found ##
sudo yum info htop
## install it ##
sudo yum install htop

And, there you have it, a larger number of packages to install from EPEL repo on a CentOS and Red Hat Enterprise Linux (RHEL) version 7.x.


You learned how to install and enable EPEL repository on a CentOS or RHEL 7.x server. See:

This entry is 2 of 5 in the Enable EPEL Repository on a CentOS/RHEL Tutorial series. Keep reading the rest of the series:
  1. CentOS / RHEL / Scientific Linux 6/5 Enable and Install EPEL Repo
  2. How To Install EPEL Repo on a CentOS and RHEL 7.x
  3. yum command: Update / Install Packages Under Redhat Enterprise / CentOS Linux Version 5.x
  4. Install and enable EPEL repo on an RHEL 8.x
  5. CentOS 8 Install and enable EPEL repo

🐧 Get the latest tutorials on Linux, Open Source & DevOps via RSS feed or Weekly email newsletter.

🐧 22 comments so far... add one

CategoryList of Unix and Linux commands
Disk space analyzersncdu pydf
File Managementcat
FirewallAlpine Awall CentOS 8 OpenSUSE RHEL 8 Ubuntu 16.04 Ubuntu 18.04 Ubuntu 20.04
Network UtilitiesNetHogs dig host ip nmap
OpenVPNCentOS 7 CentOS 8 Debian 10 Debian 8/9 Ubuntu 18.04 Ubuntu 20.04
Package Managerapk apt
Processes Managementbg chroot cron disown fg jobs killall kill pidof pstree pwdx time
Searchinggrep whereis which
User Informationgroups id lastcomm last lid/libuser-lid logname members users whoami who w
WireGuard VPNAlpine CentOS 8 Debian 10 Firewall Ubuntu 20.04
22 comments… add one
  • bminish Jun 24, 2014 @ 10:12

    yum can install directly from a url.

    $ sudo yum install 

    saves a few steps

    • Humayraa Nov 21, 2015 @ 13:31

      This Link is not available anymore..

      • zer0sig Nov 17, 2016 @ 18:05

        there’s a typo in the link – it should be https instead of http.

        sudo yum install
        does the trick. just checked it.

  • sugatang itlog Jul 5, 2014 @ 10:17

    Or better ….

    rpm -i

    in linux you can do the same using different methods!

    More power nixCraft!

  • Alan Miller Aug 28, 2014 @ 2:31

    One problem I ran into after this was needing to clean metadata using ‘sudo yum clean metadata’ – until I did that, I was getting an error of “repomd.xml does not match metalink for epel”

  • Michael Kremser Sep 2, 2014 @ 5:56

    EPEL 7 has left beta yesterday, September, 1st, 2014. You can now use the URI to download the EPEL RPM package.

  • Muhammad Sadek Sep 18, 2014 @ 6:46

    you can install directly using:

    sudo yum install epel-release

  • M B Sep 23, 2014 @ 8:47

    Epel repos need to be updated here as it’s the beta.

  • The dude Oct 2, 2014 @ 9:19

    Muhammad Sadek got it right.

    Simply running `yum install epel-release` will fetch the latest package.

    • zer0sig Nov 17, 2016 @ 18:09

      Running 7.2 I could not find the epel-release package until after I installed the rpm manually. Now it shows up.

  • caic Oct 3, 2014 @ 8:43
  • Praneeth Dec 29, 2014 @ 11:47

    This post is outdated. URL is not working. Please find the below details.

    This URL “” is not working.

    New URL is ”” is working. Please update it in your website.

    • zer0sig Nov 17, 2016 @ 18:12

      epel-release-latest-7.noarch.rpm will automatically pick the newest version of the 7 compatible epel repo packages. Current today is 7-8.

  • Wellington Torrejais da Silva Sep 2, 2015 @ 13:35


  • Hakan Orcan Oct 19, 2015 @ 8:54

    Thanks.You really saved my time.

  • DV Apr 2, 2016 @ 12:56


  • zer0sig Nov 17, 2016 @ 18:14

    Note that above the wget command references epel-release-latest-7.noarch.rpm while the yum install references epel-release-7.noarch.rpm, so if you cut and paste or type exactly what is shown you will get an error as it tries to reference a package that hasn’t been downloaded.

  • Ethan Jan 13, 2017 @ 1:47

    In second method, correct command should be:
    sudo yum install epel-release-latest-7.noarch.rpm

    • 🐧 Vivek Gite Jan 13, 2017 @ 6:49

      thanks for the feedback. I faq has been updated. Appreciate your post.

  • taikedz Feb 9, 2017 @ 17:00

    You may find on CentOS that epel-release cannot be found

    To solve, edit your /etc/yum.repos.d/CentOS-Base.repo file and enable the “extras” section, and then run

    sudo yum install epel-release

Leave a Reply

Your email address will not be published.

Use HTML <pre>...</pre> for code samples. Still have questions? Post it on our forum