Tuesday, 3 September 2013

EPEL repo installation

Many a time we may come across the situation, where we have to download the source package and install it.

Here comes the role of EPEL repo, if you enable this repo you will be able to install most of the open source packages using yum.

Now, lets see that is EPEL first.

EPEL stands for Extra Packages for Enterprise Linux.

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).

*How to see your system has epel repo enabled?

Use command: yum repolist.

Lets see the output:
===
# yum repolist
repo id          repo name                   status
base             CentOS-6 - Base             6,294
extras          CentOS-6 - Extras               4
updates       CentOS-6 - Updates            830
repolist: 7,128
===

The above result shows that, it does not have an epel repo enabled.

**How to enable epel repo:

The following steps will describe how to configure a CentOS 5.x-based or Centos 6.x-based system to use Fedora Epel repos and third party remi package repos. These package repositories are not officially supported by CentOS, but they provide much more current versions of popular applications like PHP or MYSQL.


Note: The following steps are for 64 bit systems:


Centos 5.x

run the following commands:
===
wget http://dl.fedoraproject.org/pub/epel/5/x86_64/epel-release-5-4.noarch.rpm
wget http://rpms.famillecollet.com/enterprise/remi-release-5.rpm
sudo rpm -Uvh remi-release-5*.rpm epel-release-5*.rpm
===

Centos 6.x

run the following commands:
====
wget http://dl.fedoraproject.org/pub/epel/6/x86_64/epel-release-6-8.noarch.rpm
wget http://rpms.famillecollet.com/enterprise/remi-release-6.rpm
sudo rpm -Uvh remi-release-6*.rpm epel-release-6*.rpm
====


Now, you will be able to see some additional repo definitions under /etc/yum.repos.d/
====
$ ls -1 /etc/yum.repos.d/epel* /etc/yum.repos.d/remi.repo
/etc/yum.repos.d/epel.repo
/etc/yum.repos.d/epel-testing.repo
/etc/yum.repos.d/remi.repo
===

***Enable the remi repo:
====
The remi repository provides a variety of up-to-date packages that are useful or are a requirement for many popular web-based services.

1) Open the /etc/yum.repos.d/remi.repo repository file.

2) Change the value of enabled to 1.

====
name=Les RPM de remi pour Enterprise Linux $releasever - $basearch
#baseurl=http://rpms.famillecollet.com/enterprise/$releasever/remi/$basearch/
mirrorlist=http://rpms.famillecollet.com/enterprise/$releasever/remi/mirror
enabled=1
gpgcheck=1
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-remi
failovermethod=priority
====

**The result after installing EPEL repo:
===
# yum repolist
repo id       repo name                                             status
base          CentOS-6 - Base                                       6,294
epel          Extra Packages for Enterprise Linux 6 - x86_64        7,345
extras        CentOS-6 - Extras                                         4
updates       CentOS-6 - Updates                                      928
repolist: 14,571
===

Use "yum info packagename" to get the details of package. The example for nagios package is as below:

====
yum info nagios
Available Packages
Name        : nagios
Arch        : x86_64
Version     : 3.3.1
Release     : 3.el6
Size        : 1.1 M
Repo        : epel
Summary     : Nagios monitors hosts and services and yells if somethings breaks
====


SPECIAL NOTES FOR DOWNLOADING:
=======
 # For RHEL/CentOS 6 32-Bit #
wget http://download.fedoraproject.org/pub/epel/6/i386/epel-release-6-8.noarch.rpm
rpm -ivh epel-release-6-8.noarch.rpm

# For RHEL/CentOS 6 64-Bit #
wget http://download.fedoraproject.org/pub/epel/6/x86_64/epel-release-6-8.noarch.rpm
rpm -ivh epel-release-6-8.noarch.rpm

# For RHEL/CentOS 5 32-Bit #
wget http://download.fedoraproject.org/pub/epel/5/i386/epel-release-5-4.noarch.rpm
rpm -ivh epel-release-5-4.noarch.rpm

# For RHEL/CentOS 5 64-Bit #
wget http://download.fedoraproject.org/pub/epel/5/x86_64/epel-release-5-4.noarch.rpm
rpm -ivh epel-release-5-4.noarch.rpm
========

How to Enable and Use EPEL Repo with Yum
====
yum --enablerepo=epel [command] [package name]
======

Replace the [command] part with one of these:

Important commands used are:

- install
- update
- check-update
- upgrade
- remove or erase
- list
- provides or whatprovides
- search
- info
- clean
- shell
- resolvedep
- localinstall
- localupdate
- deplist

EXAMPLE FOR INSTALLING NGINX USING YUM and EPEL REPO

===
yum --enablerepo=epel install nginx
====




No comments:

Post a comment

Note: only a member of this blog may post a comment.