How to Enable EPEL and Remi Repository into CentOS 6

EPEL stand for Extra Packages for Enterprise Linux. EPEL repository 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), Oracle Enterprise Linux(OEL). Remi repository is a yum repository maintained by a French dude – Remi Collet. This post describe the basic steps to prepare and install the additional CentOS packages with EPEL and Remi Repository into CentOS 6.

EPEL Repository

rpm --import https://dl.fedoraproject.org/pub/epel/RPM-GPG-KEY-EPEL-6
rpm -Uvh https://dl.fedoraproject.org/pub/epel/6/x86_64/epel-release-6-8.noarch.rpm

Remi Repository

rpm --import http://rpms.famillecollet.com/RPM-GPG-KEY-remi
rpm -Uvh http://rpms.famillecollet.com/enterprise/remi-release-6.rpm

Example :

[root@centos6 ~]# rpm --import https://dl.fedoraproject.org/pub/epel/RPM-GPG-KEY-EPEL-6
[root@centos6 ~]# rpm -Uvh https://dl.fedoraproject.org/pub/epel/6/x86_64/epel-release-6-8.noarch.rpm
Retrieving https://dl.fedoraproject.org/pub/epel/6/x86_64/epel-release-6-8.noarch.rpm
Preparing...                ########################################### [100%]
   1:epel-release           ########################################### [100%]
[root@centos6 ~]# rpm --import http://rpms.famillecollet.com/RPM-GPG-KEY-remi
[root@centos6 ~]# rpm -Uvh http://rpms.famillecollet.com/enterprise/remi-release-6.rpm
Retrieving http://rpms.famillecollet.com/enterprise/remi-release-6.rpm
Preparing...                ########################################### [100%]
   1:remi-release           ########################################### [100%]

Example of EPEl and Remi repo usage :

[root@centos6 ~]# yum --enablerepo=epel install httpd -y
[root@centos6 ~]# yum --enablerepo=remi install httpd -y

How to Install yum-priorities on CentOS 6.3

centos6The priorities plugin can be used to enforce ordered protection of repositories, by associating priorities to repositories. Theoretically, the repositories with the lowest numerical priority number have the highest priority. This is one of the method to prevents mistakes such as accidentally running yum upgrade with everything. This post cover the quick step to install yum-priorities on CentOS 6.3.

[root@centos63 ~]# yum install yum-priorities -y

Examples :

[root@centos63 ~]# yum install yum-priorities -y
Loaded plugins: fastestmirror, presto
Loading mirror speeds from cached hostfile
 * base: centos.ipserverone.com
 * extras: centos.ipserverone.com
 * updates: centos.ipserverone.com
Setting up Install Process
Resolving Dependencies
--> Running transaction check
---> Package yum-plugin-priorities.noarch 0:1.1.30-14.el6 will be installed
--> Finished Dependency Resolution

Dependencies Resolved

====================================================================================================
 Package                          Arch              Version                   Repository       Size
====================================================================================================
Installing:
 yum-plugin-priorities            noarch            1.1.30-14.el6             base             22 k

Transaction Summary
====================================================================================================
Install       1 Package(s)

Total download size: 22 k
Installed size: 28 k
Downloading Packages:
Setting up and reading Presto delta metadata
Processing delta metadata
Package(s) data still to download: 22 k
yum-plugin-priorities-1.1.30-14.el6.noarch.rpm                               |  22 kB     00:00
Running rpm_check_debug
Running Transaction Test
Transaction Test Succeeded
Running Transaction
  Installing : yum-plugin-priorities-1.1.30-14.el6.noarch                                       1/1
  Verifying  : yum-plugin-priorities-1.1.30-14.el6.noarch                                       1/1

Installed:
  yum-plugin-priorities.noarch 0:1.1.30-14.el6

Complete!

How to Add Remi Yum Repository on CentOS 6.3

This post cover the steps to install remi repository on linux CentOS 6.3 server. There are several 3rd party repositories for CentOS 6 server. One of the popular one is remi repository. The Remi repository is a repository containing updated PHP and MySQL packages and is maintained by Remi.

1. Import the RPM-GPG-KEY key and

[root@centos63 ~]# rpm --import http://rpms.famillecollet.com/RPM-GPG-KEY-remi

2. Download remi rpm package :

[root@centos63 ~]# wget http://rpms.famillecollet.com/enterprise/remi-release-6.rpm

Examples :

[root@centos63 ~]# wget http://rpms.famillecollet.com/enterprise/remi-release-6.rpm
--2012-08-10 00:04:32--  http://rpms.famillecollet.com/enterprise/remi-release-6.rpm
Resolving rpms.famillecollet.com... 88.191.74.232, 2a01:e0b:1:74:2e0:f4ff:fe1b:b827
Connecting to rpms.famillecollet.com|88.191.74.232|:80... connected.
HTTP request sent, awaiting response... 200 OK
Length: 5292 (5.2K) [application/x-rpm]
Saving to: âremi-release-6.rpmâ

100%[==========================================================>] 5,292       --.-K/s   in 0.02s

2012-08-10 00:04:33 (280 KB/s) - âremi-release-6.rpmâ

3. Install remi rpm package :

[root@centos63 ~]# rpm -ivh remi-release-6.rpm
Preparing...                ########################################### [100%]
   1:remi-release           ########################################### [100%]

4. Start install using Yum :

[root@centos63 ~]# yum install --enablerepo=remi httpd

How to Install and Configure yum-priorities on RHEL 6/CentOS 6

In this post, i will show on how to install and configure yum-priorities on CentOS 6 or RHEL 6 Linux server. Theoretically, the repositories with the lowest numerical priority number have the highest priority. This is one of the method to prevents mistakes such as accidentally running yum upgrade with everything. This steps has been tested on CentOS 6.2, but it may working on CentOS 6.0, CentOS 6.1 and RHEL 6 server.

1. To Install the yum-priorities, simply run this command :

[root@centos62 ~]# yum install yum-priorities -y

Example :

[root@centos62 ~]# yum install yum-priorities -y
Loaded plugins: fastestmirror
Loading mirror speeds from cached hostfile
 * base: centos.ipserverone.com
 * epel: ftp.jaist.ac.jp
 * extras: centos.ipserverone.com
 * remi: iut-info.univ-reims.fr
 * remi-test: iut-info.univ-reims.fr
 * rpmforge: ftp-stud.fht-esslingen.de
 * updates: centos.ipserverone.com
Setting up Install Process
Resolving Dependencies
--> Running transaction check
---> Package yum-plugin-priorities.noarch 0:1.1.30-10.el6 will be installed
--> Finished Dependency Resolution

Dependencies Resolved

====================================================================================================
 Package                          Arch              Version                   Repository       Size
====================================================================================================
Installing:
 yum-plugin-priorities            noarch            1.1.30-10.el6             base             22 k

Transaction Summary
====================================================================================================
Install       1 Package(s)

Total download size: 22 k
Installed size: 28 k
Downloading Packages:
yum-plugin-priorities-1.1.30-10.el6.noarch.rpm                               |  22 kB     00:00
Running rpm_check_debug
Running Transaction Test
Transaction Test Succeeded
Running Transaction
Warning: RPMDB altered outside of yum.
  Installing : yum-plugin-priorities-1.1.30-10.el6.noarch                                       1/1

Installed:
  yum-plugin-priorities.noarch 0:1.1.30-10.el6

Complete!

2. After the plugin is installed, make sure that it is enabled on /etc/yum/pluginconf.d/priorities.conf file.

[root@centos62 ~]# more /etc/yum/pluginconf.d/priorities.conf
[main]
enabled = 1

If “enabled” value = 0, you can enable it using vi editor and set it to 1.

3. With the plugin enabled, you may add priorities to the target repositories by adding the following line :

priority=N

Where N is an integer from 1 to 99. The lower the number the more important it is, so CentOS-Base.repo must always the lowest.

[root@centos62 ~]# vi /etc/yum.repos.d/CentOS-Base.repo

Add this line on base repo :

priority = 1

Example :

# CentOS-Base.repo
#
# The mirror system uses the connecting IP address of the client and the
# update status of each mirror to pick mirrors that are updated to and
# geographically close to the client.  You should use this for CentOS updates
# unless you are manually picking other mirrors.
#
# If the mirrorlist= does not work for you, as a fall back you can try the
# remarked out baseurl= line instead.
#
#

[base]
name=CentOS-$releasever - Base
mirrorlist=http://mirrorlist.centos.org/?release=$releasever&arch=$basearch&repo=os
#baseurl=http://mirror.centos.org/centos/$releasever/os/$basearch/
gpgcheck=1
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-CentOS-6
priority = 1

#released updates
[updates]
name=CentOS-$releasever - Updates
mirrorlist=http://mirrorlist.centos.org/?release=$releasever&arch=$basearch&repo=updates
#baseurl=http://mirror.centos.org/centos/$releasever/updates/$basearch/
gpgcheck=1
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-CentOS-6

#additional packages that may be useful
[extras]
name=CentOS-$releasever - Extras
mirrorlist=http://mirrorlist.centos.org/?release=$releasever&arch=$basearch&repo=extras
#baseurl=http://mirror.centos.org/centos/$releasever/extras/$basearch/
gpgcheck=1
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-CentOS-6

#additional packages that extend functionality of existing packages
[centosplus]
name=CentOS-$releasever - Plus
mirrorlist=http://mirrorlist.centos.org/?release=$releasever&arch=$basearch&repo=centosplus
#baseurl=http://mirror.centos.org/centos/$releasever/centosplus/$basearch/
gpgcheck=1
enabled=0gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-CentOS-6

#contrib - packages by Centos Users
[contrib]
name=CentOS-$releasever - Contrib
mirrorlist=http://mirrorlist.centos.org/?release=$releasever&arch=$basearch&repo=contrib
#baseurl=http://mirror.centos.org/centos/$releasever/contrib/$basearch/
gpgcheck=1
enabled=0
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-CentOS-6
-- INSERT --

4. As an example, another 3rd party repository is Remi. Follow this steps to Add the Remi Repository on CentOS 6/RHEL 6 Linux Server :
Open the Remi configuration file and insert “priority = 5” after “enabled = 1” in the [remi] section :

[root@centos62 ~]# vi /etc/yum.repos.d/remi.repo

Example :

[remi]
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
priority = 5
gpgcheck=1
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-remi
failovermethod=priority

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

How to Install Remi yum Repository on CentOS 6.2 x86 and x86_64

There are several 3rd party repositories for CentOS 6 server. One of the popular one is remi repository. The Remi repository is a repository containing updated PHP and MySQL packages and is maintained by Remi. In this post, i will show you on how to install remi repository on linux CentOS 6.2 server

Import the RPM-GPG-KEY key and install remi rpm package :

[root@centos62 ~]# rpm --import http://rpms.famillecollet.com/RPM-GPG-KEY-remi
[root@centos62 ~]# rpm -ivh http://rpms.famillecollet.com/enterprise/remi-release-6.rpm
Retrieving http://rpms.famillecollet.com/enterprise/remi-release-6.rpm
Preparing...                ########################################### [100%]
   1:remi-release           ########################################### [100%]

To enable this repo, please change “enabled” value to 1 :

[remi]
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

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