UPWORK superadmin blog

Tips and Tricks for clients

How do enable repository EPEL on CentOS 5.*, CentOS 6.* or CentOS 7.*

without comments

EPEL is maintained as part of the Fedora project that maintains several packages that are not part of the standard Red Hat Enterprise Linux (or CentOS). For example, if you are installing nagios (or bugzilla, or any other standard open source software), you’ll typically install it from source. i.e You’ll download the source code from the corresponding open source project site, and compile it on your system. You won’t be able to install those using the standard yum repositories (i.e base, updates, etc.).
If you enable EPEL, you can install nagios, or bugzilla, or any other standard open source software just using yum command.

The following yum command displays all the repositories available on your system. As you see below, it has three CentOS-6 repositories (base, extras and updates). This doesn’t have EPEL enabled yet.

[root@5_7 ~]# yum repolist
Loaded plugins: fastestmirror
Loading mirror speeds from cached hostfile
 * base: centos.intergenia.de
 * extras: centos.psw.net
 * updates: centos.intergenia.de
repo id repo name status
base  CentOS-5 - Base 2 725
extras CentOS-5 - Extras 282
updates CentOS-5 - Updates 858
repolist: 3 865
[root@5_7 ~]#

First, you need to enable EPEL repository on your system. You don’t need to configure this repository manually in your yum. Instead, download the following package and install it, which will enable the EPEL repository on your system.

epel-release-7-*.noarch – Install this on your RHEL 7 (or CentOS 7) x86_64

epel-release-6-*.noarch – Install this on your RHEL 6 (or CentOS 6) i386
epel-release-6-*.noarch – Install this on your RHEL 6 (or CentOS 6) x86_64

epel-release-5-*.noarch – Install this on your RHEL 5 (or CentOS 5) i386
epel-release-5-*.noarch – Install this on your RHEL 5 (or CentOS 5) x86_64

On my CentOS 6 system, I did the following. If you just do a “–test”, to test the installation, this will give NOKEY found warning message.

[root@5_7 ~]# rpm -ivh epel-release-5-*.noarch.rpm --test
Warning: epel-release-5-*.noarch.rpm: Header V3 DSA signature: NOKEY, key ID 217521f6
Prepare...     ########################################### [100%]
[root@5_7 ~]#

You should download the GPG key for EPEL repository from fedoraproject and install it on your system as shown below. For CentOS 6, go to fedoraproject https://fedoraproject.org/keys and download use the direct wget as shown below.

[root@5_7 ~]# LANG=en_US.UTF-8 wget \
--no-check-certificate https://fedoraproject.org/static/0608B895.txt -O RPM-GPG-KEY-EPEL-6
--2012-10-01 07:32:46-- https://fedoraproject.org/static/0608B895.txt
Resolving fedoraproject.org... 209.132.181.16, 140.211.169.197, 152.19.134.146, ...
Connecting to fedoraproject.org|209.132.181.16|:443... connected.
WARNING: certificate common name `*.fedoraproject.org' doesn't match requested
host name `fedoraproject.org'.
HTTP request sent, awaiting response... 200 OK
Length: 1715 (1.7K) [text/plain]
Saving to: `RPM-GPG-KEY-EPEL-6'
100%[==============================================>] 1,715 --.-K/s in 0.003s
2012-10-01 07:32:47 (580 KB/s) - `RPM-GPG-KEY-EPEL-6' saved [1715/1715]
[root@5_7 ~]#

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

Or for version 5.*

root@5_7 ~]# LANG=en_US.UTF-8 wget  \
--no-check-certificate https://fedoraproject.org/static/217521F6.txt -O RPM-GPG-KEY-EPEL
--2012-10-01 07:40:31-- https://fedoraproject.org/static/217521F6.txt
Resolving fedoraproject.org... 209.132.181.16, 140.211.169.197, 152.19.134.146, ...
Connecting to fedoraproject.org|209.132.181.16|:443... connected.
WARNING: certificate common name `*.fedoraproject.org' doesn't match
requested host name `fedoraproject.org'.
HTTP request sent, awaiting response... 200 OK
Length: 1820 (1.8K) [text/plain]
Saving to: `RPM-GPG-KEY-EPEL'
100%[==============================================>] 1,820 --.-K/s in 0.003s
2012-10-01 07:40:33 (518 KB/s) - `RPM-GPG-KEY-EPEL' saved [1820/1820]
[root@5_7 ~]#

mv RPM-GPG-KEY-EPEL /etc/pki/rpm-gpg
rpm --import /etc/pki/rpm-gpg/RPM-GPG-KEY-EPEL

Verify that the key got installed successfully.

# rpm -qa gpg*

Now install the epel-release-(5)6-*.noarch package, which will enable EPEL repository on your system.

# rpm -ivh epel-release-*-*.noarch.rpm --test
Preparing... ########################################### [100%]
1:epel-release-*-*.noarch########################################### [100%]
GPG Key ID

As you see from the above rpm command, it says “key ID *: NOKEY”. This indicates that this is looking for the GPG key with id *. When you downloaded the key from fedoraproject, notice that the GPG key is stored in a filename that is just the keyid. As you see from above, we downloaded *.txt from fedoraproject website.
Once you’ve installed the key, if you do “rpm -qa gpg*”, you’ll see that the gpg key with the keyid * is installed. The key id * is part of the gpg package name as shown below.

# rpm -qa gpg*
gpg-pubkey-*-*
Verify EPEL

Verify that the EPEL repository is enabled.

# yum repolist

Now you should be able to install lot of standard open source software directly using yum. Now if you do ‘yum info NAME’, it will show the following information. Check the line that starts with “Repo”, which has the value of “epel”, which indicates that this package is from epel repository.

# yum info NAME

Available Packages
Name : NAME
Arch : x86_64
Version : ***
Release : ***
Size : * M
Repo : epel
Summary : ****

Also for info: http://www.webmaster.net/how-install-epel-repo-centos-6x

Written by spectre

October 1st, 2012 at 1:12 pm

Posted in Tips and Tricks

Leave a Reply

*