Hey all,
Most searches for installing the EPEL repository that I have found have you use Yum to install the repo from an RPM file. But, I want to should you how to manually create the repo on your CentOS 7 system. But first, if you insist on doing things the boring way… here’s how.
The boring way according to the EPEL web site is currently:
sudo yum install epel-release
This package is included in the Extras repository which is on by default, but I typically turn it off. If you disabled the Extras repo as I do, you may need to run it like this:
sudo yum –enablerepo=Extras install epel-release
No that we have that boring stuff out of the way, let’s install EPEL manually. As the super user, create a file in the folder /etc/yum.repo.d/
sudo vi /etc/yum.repo.d/epel.repo
Then put the following lines (change the enabled=0 to a 1 if you want to enable it. I strongly recommend leaving it disabled and just enable it when you need to like in the example a little lower).
# epel.repo
#
# Extended Packages for Enterprise Linux
#
#
[epel]
name=EPEL for CentOS 7
baseurl=https://dl.fedoraproject.org/pub/epel/7/x86_64/
gpgcheck=1
enabled=0
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-EPEL-7
Then create a text file, /etc/pki/rpm-gpg/RPM-GPG-KEY-EPEL-7
Open the following GPG key file and copy the contents into the text file above:
https://getfedora.org/static/352C64E5.txt
you can use wget if you have it installed like this (yes that is a capital “oh”):
sudo wget -O /etc/pki/rpm-gpg/RPM-GPG-KEY-EPEL-7 https://getfedora.org/static/352C64E5.txt
The first time you run yum you may get an error:
# yum –disablerepo=* –enablerepo=epel install clamav clamd
warning: /var/cache/yum/x86_64/7/epel/packages/clamav-0.99.2-1.el7.x86_64.rpm: Header V3 RSA/SHA256 Signature, key ID 352c64e5: NOKEY
Retrieving key from file:///etc/pki/rpm-gpg/RPM-GPG-KEY-EPEL-7
Importing GPG key 0x352C64E5:
Userid : “Fedora EPEL (7) <epel@fedoraproject.org>”
Fingerprint: 91e9 7d7c 4a5e 96f1 7f3e 888f 6a2f aea2 352c 64e5
From : /etc/pki/rpm-gpg/RPM-GPG-KEY-EPEL-7
Is this ok [y/N]: y
Just hit “y” like the example above, and future yum calls will go through without any warning. You can verify the “Fingerprint” here (click on the EPEL 7 “Primary” link):
https://getfedora.org/keys/
Please let me know if you have any questions. Leave a comment and I will answer as soon as I can. Or contact us through the Contact page.