EPEL Install

The purpose of this document is to explain how to install EPEL on CentOS.

1. Verify your current repo list

yum repolist Loaded plugins: fastestmirror Loading mirror speeds from cached hostfile * base: centos.mirror.constant.com * extras: mirrors.seas.harvard.edu * updates: centos.mirror.nac.net repo id repo name status base CentOS-6 - Base 6,346 extras CentOS-6 - Extras 4 updates CentOS-6 - Updates 742 repolist: 7,092

2. Download the EPEL GPG key from fedoraproject.org: https://fedoraproject.org/keys . Find the key titled "RPM-GPG-KEY-EPEL" and use wget to download it:

  • wget --no-check-certificate https://fedoraproject.org/static/0608B895.txt

3. Move that file to /etc/pki/rpm-gpg/RPM-GPG-KEY-EPEL-6:

  • mv 0608B895.txt /etc/pki/rpm-gpg/RPM-GPG-KEY-EPEL-6

4. Import the key with RPM

  • rpm --import /etc/pki/rpm-gpg/RPM-GPG-KEY-EPEL-6

5. Download and install the RPM for the repo (see here and here for links to the latest RPM):

  • wget http://mirror.cogentco.com/pub/linux/epel/6/i386/epel-release-6-7.noarch.rpm

  • yum localinstall epel-release-6-7.noarch.rpm

6. Verify that the key is assessible by yum

  • l /etc/yum.repos.d/

total 32K drwxr-xr-x. 2 root root 4.0K Oct 13 17:55 . drwxr-xr-x. 58 root root 4.0K Oct 10 23:55 .. -rw-r--r--. 1 root root 1.9K Jun 26 10:30 CentOS-Base.repo -rw-r--r--. 1 root root 637 Jun 26 10:30 CentOS-Debuginfo.repo -rw-r--r--. 1 root root 626 Jun 26 10:30 CentOS-Media.repo -rw-r--r--. 1 root root 2.6K Jun 26 10:30 CentOS-Vault.repo -rw-r--r--. 1 root root 957 May 9 16:55 epel.repo -rw-r--r--. 1 root root 1.1K May 9 16:55 epel-testing.repo

  • yum repolist

Loaded plugins: fastestmirror Loading mirror speeds from cached hostfile * base: mirror.ash.fastserv.com * epel: epel.mirror.constant.com * extras: mirror.steadfast.net * updates: mirror.us.leaseweb.net repo id repo name status base CentOS-6 - Base 6,346 epel Extra Packages for Enterprise Linux 6 - x86_64 7,897 extras CentOS-6 - Extras 4 updates CentOS-6 - Updates 742 repolist: 14,989

6. Verify that it actually works, install htop (optional):

  • yum -y install htop

Appendix A: If things go wrong

You can forcefully reinstall the repo as follows:

  • rpm -e epel-release-6-7.noarch

  • rm /etc/yum.repos.d/*epel*

  • yum localinstall epel-release-6-7.noarch.rpm

[Edit]