How to enable EPEL repository

This article helps you to understand, how to enable or configure the EPEL repository.

About EPEL

EPEL stands for Extra Packages for Enterprise Linux. This repository is maintained by a group Fedora community members. It is a free and open source repository. It is not only for Enterprise Linux but also supports for Redhat Enterprise Linux, CentOS, Oracle Linux, and Scientific Linux.

How to enable EPEL repository in RHEL/CentOS 7

RHEL/CentOS 7:-

To execute below commands please switch to root user.

Step1:-

[root@localhost ~]# wget http://dl.fedoraproject.org/pub/epel/epel-release-latest-7.noarch.rpm

[root@localhost ~]# rpm -ivh epel-release-latest-7.noarch.rpm
Preparing... ################################# [100%]
Updating / installing...
1:epel-release-7-11 ################################# [100%]

Step2:-

[root@localhost ~]# yum install https://dl.fedoraproject.org/pub/epel/epel-release-latest-7.noarch.rpm

This rpm can be downloaded from Fedora official page. https://fedoraproject.org/wiki/EPEL

RHEL/CentOS 6:-

[root@localhost ~]# wget https://dl.fedoraproject.org/pub/epel/epel-release-latest-6.noarch.rpm

[root@localhost ~]# rpm -ivh epel-release-latest-6.noarch.rpm

 

Once you completed the installation you can confirm it with the help of below command.

[root@localhost ~]# yum repolist
Loaded plugins: fastestmirror
Loading mirror speeds from cached hostfile
* base: centos.excellmedia.net
* epel: del-repos.extreme-ix.org
* extras: centos.excellmedia.net
* updates: centos.excellmedia.net
repo id repo name status
base/7/x86_64 CentOS-7 - Base 9,911
epel/x86_64 Extra Packages for Enterprise Linux 7 - x86_64 12,672
extras/7/x86_64 CentOS-7 - Extras 402
updates/7/x86_64 CentOS-7 - Updates 1,333
repolist: 24,318

How to remove the EPEL repository?

If you want to remove the installed repository run below commands.

[root@localhost ~]# rpm -qf /etc/yum.repos.d/epel.repo
epel-release-7-11.noarch

[root@localhost ~]# yum remove epel-release

[root@localhost ~]# yum clean all

 

One Comment

  1. It’s really useful those who are working on CentOS as some of the latest rpms are available only in EPEL repository and it will not be enabled by default as like yum repository in RedHat(eg: chrony rpm is available in EPEL repository which mandatory for ec2 instances).
    I prefer to use “rpm -e –nodeps” to remove the rpms from the server as it will not throw any error even if the dependent rpms are still exist.

Leave a Reply

Your email address will not be published. Required fields are marked *