0 Shares 2228 Views 1 Comments
02 May

How To Install Epel Repo on CentOS 6 or 7

Oliver Krautscheid Jul 18, 2015
0 2229 1

CentOS is one of the most reliable server operating systems. However, even CentOS does not include all RPM’s required to run and administrate your own web server. There are a bunch of great Repo’s you may want to install first, so you can use yum to quickly install a lot of packages

Warning: WHM / Plesk Servers Most Likely Do NOT Require This

Before you are trying to follow this guide, make sure your server requires it. WHM or PLESK servers usually don’t require it, unless you messed up the server and uninstalled the EPEL repo. To verify that you need the repo, go to your yum repo directory and verify there is no file called epel.repo

cd /etc/yum.repos.d

Sample Output: atomic.repo, CentOS-Base.repo, CentOS-Debuginfo.repo, CentOS-Media.repo, CentOS-Vault.repo, epel.repo, epel-testing.repo

Downloading The Correct Repo For Your CentOS Version (32-bit or 64-bit)

To make sure you install the correct repo, you first need to check your OS. If you don’t know what version of CentOS you are on (32-bit or 64-bit) then read this guide

1. Alright, the two most important URL’s for this where you can find all sorts of useful RPM’s are:

  • 64-bit EPEL 6: https://dl.fedoraproject.org/pub/epel/6/x86_64/epel-release-6-8.noarch.rpm
  • 32-bit EPEL 6: https://dl.fedoraproject.org/pub/epel/6/i386/
  • 64-bit EPEL 7: https://dl.fedoraproject.org/pub/epel/7/x86_64/

The direct link for the latest 6.8 EPEL Repo are below, please keep in mind that it is a good practice to always download the latest Repo. By the time you read this, 6.8 may no longer be the latest Repo. You can verify that by using the links above and searching for “epel”.


64-bit (x64)

cd /root/scripts
wget https://dl.fedoraproject.org/pub/epel/6/x86_64/epel-release-6-8.noarch.rpm

32-bit (x32)

cd /root/scripts

Sample Output:
Downloading Epel Repo For Centos.png


64-bit (x64)

cd /root/scripts
wget https://dl.fedoraproject.org/pub/epel/7/x86_64/e/epel-release-7-5.noarch.rpm

Adding REPO Key For EPEL 6 (CentOS 6) and EPEL 7 (CentOS 7)

If you have worked with rpm’s before, you will most likely know that you can install them with usually just one command. However, when trying to install the EPEL repo you will also need to install a key or you will get an error similar to this:

Epel Repo Key.png

You need the key to verify you are obtaining a legit / unmodified copy of the repo.


To get a key, you can go to https://getfedora.org/keys/ – the direct link to the EPEL 6 (6 stands for CentOS 6 here) can be accessed using this link:


When you’re trying to download the key using an insecure connection you will get an error “certificate common name”. To connect to fedoraproject.org insecurely use –no-check-certificated

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

Once you have it, run the following commands as well. We are creating a backup of your current key and then we will move the key we downloaded to the correct directory and then import it.

If you are on a WHM server, you should be aware that your cp is probably aliased, which means that in order to run cp -rf you will most likely have to enter \cp -rf to force overwrite. Finally, the last line imports your new key.

cp /etc/pki/rpm-gpg/RPM-GPG-KEY-EPEL-6 /etc/pki/rpm-gpg/RPM-GPG-KEY-EPEL-6.bak
\cp -rf 0608B895.txt /etc/pki/rpm-gpg/RPM-GPG-KEY-EPEL-6
rpm --import /etc/pki/rpm-gpg/RPM-GPG-KEY-EPEL-6

For EPEL7 modify the commands.

Verifying That Your Key Got Installed Successfully

rpm -qa gpg*

Finally: Installing EPEL Repo via RPM

Execute this command:

rpm -ivh epel-release-6-8.noarch.rpm

Or for EPEL 7:

rpm -ivh epel-release-7-5.noarch.rpm

You should know get a message that the repo has been successfully installed. Personally, I am on a WHM server where the epel.repo already exists. If you intend to set up a webserver, I definitely urge you to shell out some extra money for a WHM / Cpanel license. Plesk is another alternative, but WHM is the industry standard and updated quite frequently.

About Us

Webmaster .Net is your all-in-one resource for blogging tips, system administration guides, industry news and a growing community of webmasters.

Can't find something or want to tip us?Contact@webmaster.net

Bulls and Bears
  • https://www.webmaster.net Oliver Krautscheid

    If you’re getting the error “yum update error initscripts requires etc/system-release” – then cd into /etc/yum.repos.d and check for the CentOS repo files. If you see an old repo file with either links to CentOS4 or 5 or to your host, then move that one directory up using mv. Replace with a proper repo file

Webmaster Tutorials, Wordpress
0 shares661 views

WordPress SQL Query: Select And Delete Posts Between Two Dates

Oliver Krautscheid - Apr 08, 2017

If you are wondering how to delete posts for a certain date, you will need to know how Wordpress stores…

Advertising and Ad Networks, Copywriting
0 shares806 views

15 Tips For Increasing Facebook Ads CTR – Full Guide [2017 Update]

Cam Connor - Mar 30, 2017

In this article, we'll talk a lot about how you can write quality text ads on Facebook Ads to get…

Webmaster Tutorials
0 shares1484 views

10 Steps To Configure Nginx For WordPress, Drop Varnish And Cut Your CPU Load By 50%

Oliver Krautscheid - Oct 10, 2016

Are you using Varnish on your Wordpress blog? Possibly the Varnish script by Unixy? Great! Get rid off it. Here's…

Follow Us And get latest news

© 2016 Webmaster.Net - Property of Peakstone Media Ltd. - All rights reserved. | Privacy Policy | DMCA | Contact Us | Advertise