≡ Menu

Red Hat Enterprise Linux / CentOS Linux Enable EPEL (Extra Packages for Enterprise Linux) Repository

How do I enable EPEL (Extra Packages for Enterprise Linux) repo and install the packages under a RHEL / CentOS Linux server system?

EPEL (Extra Packages for Enterprise Linux) is a volunteer-based community effort from the Fedora project to create a repository of high-quality add-on packages that complement the Fedora-based Red Hat Enterprise Linux (RHEL) and its compatible spinoffs, such as CentOS and Scientific Linux.
EPEL provide lots of packages for CentOS / RHEL, It is not part of RedHat or CentOS but is designed to work with these major distributions. Please note that EPEL only provides free and open source software unencumbered by patents or any legal issues. In short you will not find mp3, dvd and music / media player under EPEL. However, you will find many programs related to networking, monitoring, sys admin, programming and so on.

Packages are supplied in RPM format and in most cases are ready to use. Beware that some packages may break something and you should not blindly install those packages.

How to install EPEL and additional repositories on CentOS and Red Hat Linux?

  1. Open a shell prompt.
  2. Or login to a host called server1 using ssh client.
  3. Type the following wget command: wget https://dl.fedoraproject.org/pub/epel/epel-release-latest-7.noarch.rpm
  4. Install epel using the following command: rpm -ivh epel-release-latest-7.noarch.rpm

Examples: How Do I Enable EPEL Repo under CentOS or RHEL Servers?

You need to type the following command as per your distro version / release.

Examples for RHEL 5.x / CentOS 5.x Users

Type the following command as root user to install repo:
# rpm -Uvh https://dl.fedoraproject.org/pub/epel/epel-release-latest-5.noarch.rpm

Examples for RHEL 6.x / CentOS 6.x Users

Type the following command as root user to install repo:
# rpm -Uvh https://dl.fedoraproject.org/pub/epel/epel-release-latest-6.noarch.rpm

Examples for RHEL 7.x / CentOS 7.x Users

Type the following command as root user to install repo:
# rpm -Uvh https://dl.fedoraproject.org/pub/epel/epel-release-latest-7.noarch.rpm
OR use the following command:
# yum install epel-release.noarch
Sample outputs:

Fig.01: Installing repo on a CentOS 7 server

Fig.01: Installing repo on a CentOS 7 server

Protect Base Packages

You need to to protect base and core packages from EPEL and other repositories. Type the following command under RHEL 6/CentOS 6:

Note for RHN (Red Hat) users: You need to also enable the 'optional' repository to use EPEL packages as they depend on packages in that repository. This can be done by enabling the RHEL optional subchannel for RHN-Classic. For certificate-based subscriptions see RHEL Deployment Guide

# yum install yum-plugin-protectbase.noarch
Sample outputs:

Loaded plugins: product-id, rhnplugin, subscription-manager
Updating certificate-based repositories.
Setting up Install Process
Resolving Dependencies
--> Running transaction check
---> Package yum-plugin-protectbase.noarch 0:1.1.30-10.el6 will be installed
--> Finished Dependency Resolution
Dependencies Resolved
 Package                    Arch       Version              Repository                         Size
 yum-plugin-protectbase     noarch     1.1.30-10.el6        rhel-x86_64-server-optional-6      20 k
Transaction Summary
Install       1 Package(s)
Total download size: 20 k
Installed size: 0
Is this ok [y/N]: y
Downloading Packages:
yum-plugin-protectbase-1.1.30-10.el6.noarch.rpm                              |  20 kB     00:00
Running rpm_check_debug
Running Transaction Test
Transaction Test Succeeded
Running Transaction
  Installing : yum-plugin-protectbase-1.1.30-10.el6.noarch                                      1/1
Installed products updated.
  yum-plugin-protectbase.noarch 0:1.1.30-10.el6

RHEL 5/ CentOS 5 user type the following command to protect packages:
# yum install yum-protectbase.noarch
This plugin allows certain repositories to be protected. Packages in the protected repositories can't be overridden by packages in non-protected repositories even if the non-protected repo has a later version.

How Do I Use EPEL Repo?

To list newly installed repo, enter:
# yum repolist
Sample output:

Loading "skip-broken" plugin
Loading "fastestmirror" plugin
repo id              repo name                                 status
addons               CentOS-5 - Addons                         enabled
base                 CentOS-5 - Base                           enabled
epel                 Extra Packages for Enterprise Linux 5 -   enabled
extras               CentOS-5 - Extras                         enabled
updates              CentOS-5 - Updates                        enabled

Now, use the yum command to list, view and install the packages:
# yum search package-name
# yum install package-name

For example search htop package and install it:
# yum search htop
# yum install htop

See how to use yum command for installing and searching packages using various repos.

Further readings:

{ 16 comments… add one }

  • Sam May 6, 2009, 1:18 pm

    I think it would be helpful if you also mention how to use yum-priorities, which is recommended when one plans to use 3rd party repos (like EPEL).

  • Amila Withanage August 2, 2009, 5:41 am

    Very useful article. It enables to find various packages which are not avaialble in CentOS repository or rpm.forge repository. Thank you Vivek.

    Amila Withanage

  • Balwinder Sigh Sidhu October 7, 2009, 5:12 am

    Really it is very helpfull to all, which people want to know more about linux. i really very thankful to this group. it is greate affort for us..!! thank you …….

  • Maxbyte October 24, 2009, 4:14 am

    This is excellent stuff! Thank you. It stands on its own feet with appropriate links and examples, and it provides those of us with less than complete Linux knowledge with straightforward guidance in security enhancement.

  • Kiran December 8, 2009, 7:36 pm

    I tried the above steps however it gives me error, i could able to install the package manually by downloading it from the website because i was not able to upgrade it directly from the Web. And After instillation of the package i tried to run the command “yum repolist” however i am getting the error message as “[root@gk ~]# yum repolist
    Loading “rhnplugin” plugin
    Loading “installonlyn” plugin
    This system is not registered with RHN.
    RHN support will be disabled. ”

    Can you please let me know am i going wrong somewhere or i am missing anything somewhere.

  • Jamin September 28, 2010, 4:43 pm

    IF you are running RHEL, use the package yum-protectbase instead of yum-priorities.

  • alex April 3, 2011, 12:23 am

    if you are getting errors try

    rpm -Uvh http://download.fedora.redhat.com/pub/epel/5/i386/epel-release-5-4.noarch.rpm
  • Rafael Holanda April 15, 2011, 2:50 pm

    Link correto:

    rpm -Uvh http://download.fedora.redhat.com/pub/epel/5/i386/epel-release-5-4.noarch.rpm
  • Jimbo March 30, 2012, 3:43 am

    It is now:

  • nixCraft March 30, 2012, 6:31 am


    The faq has been updated with correct url and also covers installation of yum-plugin-protectbase.

  • biwebco July 2, 2012, 10:14 pm

    for Rhel5 should not be EPEL5 instead of EPEL6?:

    EPEL6 in Centos5:
    Failed dependencies:
    rpmlib(FileDigests) <= 4.6.0-1 is needed by epel-release-6-7.noarch
    rpmlib(PayloadIsXz) <= 5.2-1 is needed by epel-release-6-7.noarch

  • Ferdian July 26, 2012, 5:14 am

    Correct URL

    CentOS 6.x 32-bit (x86/i386):

    rpm -Uvh http://mirror.overthewire.com.au/pub/epel/6/i386/epel-release-6-7.noarch.rpm

    CentOS 6.x 64-bit (x64):

    rpm -Uvh http://download.fedoraproject.org/pub/epel/6/x86_64/epel-release-6-7.noarch.rpm

    CentOS 5.x 32-bit (x86/i386):

    rpm -Uvh http://dl.fedoraproject.org/pub/epel/5/i386/epel-release-5-4.noarch.rpm

    CentOS 5.x 64-bit (x64):

    rpm -Uvh http://dl.fedoraproject.org/pub/epel/5/x86_64/epel-release-5-4.noarch.rpm
  • Dantevios October 4, 2012, 8:49 pm

    Any lines like this:

    rpm -Uvh http://download.fedoraproject.org/pub/epel/6/i386/epel-release-6-5.noarch.rpm

    should be:

    rpm -Uvh http://download.fedoraproject.org/pub/epel/6/`uname -m`/epel-release-6-5.noarch.rpm

    In order for this tutorial to be unbiased against different chip architectures. Other than that, thank you!

  • Alex CW October 15, 2013, 5:35 pm

    This is very helpful — thank you! However, I keep getting an error. When inputting:

    yum install yum-plugin-protectbase.noarch

    it returns:

    No package yum-plugin-protectbase.noarch available.

    I’m on RHEL 6.4 on a fresh installation. Using yum repolist shows that EPEL is installed. Any ideas?

    • nixCraft October 15, 2013, 7:45 pm

      Run yum repolist command and make sure “rhel-x86_64-server-optional-6” repo-id is listed:

      yum repolist
  • Hafiz Muhammad Shafiq May 14, 2014, 4:47 am

    How to install epel-release on fedora 20. when I try to install it gives following error
    epel-release conflicts with fedora-release-20-3.noarch

Leave a Comment

   Tagged with: , , ,