Thursday 22 December 2011

Enabling EPEL repo in RHEL / CENTOS

EPEL - Extra Packages for Enterprise Linux.

What is Extra Packages for Enterprise Linux (or EPEL)?
Extra Packages for Enterprise Linux (or EPEL) is a Fedora Special Interest Group that creates, maintains, and manages a high quality set of additional packages for Enterprise Linux, including, but not limited to, Red Hat Enterprise Linux (RHEL), CentOS and Scientific Linux (SL).
EPEL packages are usually based on their Fedora counterparts and will never conflict with or replace packages in the base Enterprise Linux distributions. EPEL uses much of the same infrastructure as Fedora, including buildsystem, bugzilla instance, updates manager, mirror manager and more.

What packages and versions are available in EPEL?
How to use Packages?
There are two ways to use these packages.
One is to download and install the epel rpm file. Once installed the repository information is automatically set, so we dont want know anything more.
The other is to manually configure the repository information. In this we need to know the url to the packages.

Method 1:
Download the epel rpm file that suites your OS.
If you are using an EL6 version: epel-release-6-5.noarch.rpm
If you are using an EL5 version: epel-release-5-4.noarch.rpm
If you are using an EL4 version: epel-release-4-10.noarch.rpm

Method 2:
This is to manually configure the EPEL repository. To do this create a file named *.repo in the /etc/yum.repos.d/ directory.

On a text editor example on vim,
Eg: # vim /etc/yum.repos.d/epel.repo


The contents inside will vary according to the EL version you are using.
For EL6: i386 version,
[epel]
name=Extra Packages for Enterprise Linux 6
http://download.fedora.redhat.com/pub/epel/6/i386/
enabled=1
gpgcheck=1
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-EPEL-6


x86_64 version,
[epel]
name=Extra Packages for Enterprise Linux 6
http://download.fedora.redhat.com/pub/epel/6/x86_64/
enabled=1
gpgcheck=1
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-EPEL-6


For EL5: i386 version,
[epel]
name=Extra Packages for Enterprise Linux 5
http://download.fedora.redhat.com/pub/epel/5/i386/
enabled=1
gpgcheck=1
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-EPEL-5

x86_64 version,
[epel]
name=Extra Packages for Enterprise Linux 5
http://download.fedora.redhat.com/pub/epel/5/x86_64/
enabled=1
gpgcheck=1
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-EPEL-5

For EL5 Server: i386 version,
[epel]
name=Extra Packages for Enterprise Linux 5 Server
http://download.fedora.redhat.com/pub/epel/5Server/i386/
enabled=1
gpgcheck=1
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-EPEL-5


x86_64 version,
[epel]
name=Extra Packages for Enterprise Linux 5 Server
http://download.fedora.redhat.com/pub/epel/5Server/x86_64/
enabled=1
gpgcheck=1
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-EPEL-5

For EL5 Client: i386 version,
[epel]
name=Extra Packages for Enterprise Linux 5 Client
http://download.fedora.redhat.com/pub/epel/5Client/i386/
enabled=1
gpgcheck=1
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-EPEL-5


x86_64 version,
[epel]
name=Extra Packages for Enterprise Linux 5 Client
http://download.fedora.redhat.com/pub/epel/5Client/x86_64/
enabled=1
gpgcheck=1
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-EPEL-5


For EL4: i386 version,
[epel]
name=Extra Packages for Enterprise Linux 4
http://download.fedora.redhat.com/pub/epel/4/i386/
enabled=1
gpgcheck=1
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-EPEL-4

x86_64 version,
[epel]
name=Extra Packages for Enterprise Linux 4
http://download.fedora.redhat.com/pub/epel/4/x86_64/
enabled=1
gpgcheck=1
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-EPEL-4

For EL4 AS: i386 version,
[epel]
name=Extra Packages for Enterprise Linux 4 AS
http://download.fedora.redhat.com/pub/epel/4AS/i386/
enabled=1
gpgcheck=1
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-EPEL-4

x86_64 version,
[epel]
name=Extra Packages for Enterprise Linux 4 AS
http://download.fedora.redhat.com/pub/epel/4AS/x86_64/
enabled=1
gpgcheck=1
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-EPEL-4

For EL4 ES: i386 version,
[epel]
name=Extra Packages for Enterprise Linux 4 ES
http://download.fedora.redhat.com/pub/epel/4ES/i386/
enabled=1
gpgcheck=1
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-EPEL-4

x86_64 version,
[epel]
name=Extra Packages for Enterprise Linux 4 ES
http://download.fedora.redhat.com/pub/epel/4ES/x86_64/
enabled=1
gpgcheck=1
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-EPEL-4

For EL4 WS: i386 version
[epel]
name=Extra Packages for Enterprise Linux 4 WS
http://download.fedora.redhat.com/pub/epel/4WS/i386/
enabled=1
gpgcheck=1
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-EPEL-4

x86_64 version,
[epel]
name=Extra Packages for Enterprise Linux 4 WS
http://download.fedora.redhat.com/pub/epel/4WS/x86_64/
enabled=1
gpgcheck=1
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-EPEL-4

Import the GPG Keys
Once you have completed the previous step, you need to download and import the RPM GPG keys manually.
For EPEL  click here.
For EPEL-6 click here.
For EPEL-5 click here.
For EPEL-4 click here.

Once you click the above link the key will be opened in a new window as a text file and what you have to do is to copy the displayed key and save as a file annywhere say for example in your home dircetory. Alternatively you can also right-click the link and select save link as option to save the text file.
Now Import the key using
# rpm --import <the name or path to the txt file>

You can verify these packages and their keys from the Fedora project's keys page:
https://fedoraproject.org/keys
http://download.fedora.redhat.com/pub/epel


Verifying
Now you can check whether the repo is corrrectly configured by,
# yum repolist

Sample Output

[root@localhost ~]# yum repolist
Loaded plugins: refresh-packagekit, rhnplugin
This system is not registered with RHN.
RHN support will be disabled.
repo id                          repo name                                                                status
epel                             Extra Packages for Enterprise Linux 6 - x86_64                           6,739
repolist: 6,739

Now you can list, view and install packages

# yum list all
# yum list package-name
# yum search package-name
# yum install package-name

Note: Also remember to clean the old database if you are getting any error.
# yum clean all
then again
# yum list all

References:
http://fedoraproject.org/wiki/EPEL
https://fedoraproject.org/keys
http://download.fedora.redhat.com/

1 comment:

  1. These are genuinely impressive ideas in regarding blogging. You have touched some nice factors here. Any way keep up wrinting.

    ReplyDelete

Navigation by WebRing.