How to Enable the EPEL repository on CentOS

By 

Published on

2 min read

Enable the EPEL repository on CentOS

The EPEL (Extra Packages for Enterprise Linux) repository provides additional software packages that are not included in the standard Red Hat and CentOS repositories. EPEL repository was created because Fedora contributors wanted to use the packages they maintain on Red Hat Enterprise Linux (RHEL) and its derivatives such as CentOS, Oracle Linux, and Scientific Linux.

Enabling this repository gives you access to popular software packages including Nginx , R , and Python Pip .

In this tutorial, we will show you how to enable the EPEL repository on CentOS.

Prerequisites

Before starting with the tutorial, make sure you are logged in as a user with sudo privileges .

Enabling the EPEL Repository on CentOS 7

Enabling the EPEL repository on CentOS 7 is a pretty simple task as the EPEL rpm package is included in the CentOS extras repository.

To install the EPEL release package, type the following command:

Terminal
sudo yum install epel-release

To verify that the EPEL repository is enabled run the yum repolist command that will list all available repositories.

Terminal
sudo yum repolist

The command will display the repo ID, name and the number of packages for the enabled repositories. The output should include a line for the EPEL repository.

output
Loaded plugins: fastestmirror, langpacks
Loading mirror speeds from cached hostfile
...
repo id             repo name                                         status
base/7/x86_64       CentOS-7 - Base                                   10,019
epel/x86_64         Extra Packages for Enterprise Linux 7 - x86_64    12,912
extras/7/x86_64     CentOS-7 - Extras                                    371
updates/7/x86_64    CentOS-7 - Updates                                 1,098
repolist: 24,400

That’s it. EPEL repository has been enabled on your CentOS system.

Enabling the EPEL Repository on RHEL

This method will work on any RHEL based distribution including Red Hat, CentOS 6 and 7, Oracle Linux, Amazon Linux, and Scientific Linux.

To enable the EPEL repository, run the following command which will download and install the EPEL release package:

Terminal
sudo yum install https://dl.fedoraproject.org/pub/epel/epel-release-latest-$(rpm -E '%{rhel}').noarch.rpm
Info
rpm -E '%{rhel}' will print the distribution version (6 or 7).

Conclusion

For more information about the EPEL repository, see the EPEL documentation .

Feel free to leave a comment if you have any questions.

Linuxize Weekly Newsletter

A quick weekly roundup of new tutorials, news, and tips.

About the authors

Dejan Panovski

Dejan Panovski

Dejan Panovski is the founder of Linuxize, an RHCSA-certified Linux system administrator and DevOps engineer based in Skopje, Macedonia. Author of 800+ Linux tutorials with 20+ years of experience turning complex Linux tasks into clear, reliable guides.

View author page