• Sales: 1-800-961-2888
  • Support: 1-800-961-4454

Installing RHEL EPEL Repo on Centos 5.x or 6.x


How to install RHEL EPEL repository on Centos 5.x or 6.x

The following article 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.

Install the extra repositories

The first step requires downloading some RPM files that contain the additional YUM repository definitions. The instructions below point to the 64-bit versions that work with our Cloud Server instances.

Centos 5.x

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

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

Once installed you should see some additional repo definitions under the /etc/yum.repos.d directory.

$ 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 repository

The remi repository provides a variety of up-to-date packages that are useful or are a requirement for many popular web-based services. That means it generally is not a bad idea to enable the remi repositories by default.

First, open the /etc/yum.repos.d/remi.repo repository file using a text editor of your choice:

sudo vim /etc/yum.repos.d/remi.repo

Edit the [remi] portion of the file so that the enabled option is set to 1. This will enable the remi repository.

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

You will now have a larger array of yum repositories from which to install.



© 2011-2013 Rackspace US, Inc.

Except where otherwise noted, content on this site is licensed under a Creative Commons Attribution-NonCommercial-NoDerivs 3.0 Unported License


See license specifics and DISCLAIMER

44 Comments

For CentOS 6, http://download.fedora.redhat.com/pub/epel/6/i386/epel-release-6-5.noarch.rpm is returning a 404 error.

Thanks Melanie. Looks like they changed the domain. I'll update the article with the newer link:

http://dl.fedoraproject.org/pub/epel/6/x86_64/epel-release-6-5.noarch.rpm

for centos 6 i tried:

wget http://dl.fedoraproject.org/pub/epel/6/x86_64/epel-release-6-5.noarch.rpm
wget http://rpms.famillecollet.com/enterprise/remi-release-6.rpm
sudo rpm -Uvh remi-release-6*.rpm epel-release-6.*.rpm

and the first two commands worked, the last one returned:

[root@**** ~]# sudo rpm -Uvh remi-release-6*.rpm epel-release-6.*.rpm
error: File not found by glob: epel-release-6.*.rpm

ps is there anyway to be notified about replies to these comments? thanks!

fyi, there was a typo in code, an extra '.':

replace:

sudo rpm -Uvh remi-release-6*.rpm epel-release-6.*.rpm

with:

sudo rpm -Uvh remi-release-6*.rpm epel-release-6*.rpm

Thanks for catching that - I've fixed it in the article.

Alas, there isn't a way to get comment replies emailed to you right now. It would definitely be a useful feature.

This link: http://dl.fedoraproject.org/pub/epel/6/x86_64/epel-release-6-5.noarch.rpm

Should be:
http://dl.fedoraproject.org/pub/epel/6/x86_64/epel-release-6-6.noarch.rpm

6.7 is current not 6.6

wget http://dl.fedoraproject.org/pub/epel/6/x86_64/epel-release-6-7.noarch.rpm

The link has moved again - a bit harder to find this time:
http://dl.fedoraproject.org/pub/epel/6/SRPMS/epel-release-6-7.src.rpm

You're right about that being for the sources, but the RPM did change to 6.7 too. Article updated. Thanks!

urgh, scratch that. They're the sources of course.

Hi Rackspace,

Nice article !! It worked fine for me. I needed to install "phpldapadmin" on CentOS-6 through epel repo.
Just got one warning "RPMDB altered outside of yum.". Guess, this is due to importing the GPG key from Fedora Project. Please correct me, if I am wrong.

Thanks,
-Bijit Bhattacharjee

Yes, that should be normal to get a warning the first time you use the EPEL repository after installing it via RPM. It's a safety feature, making sure that the new repository is only used if you know about the change and it was intentional.

Hi Rack,

To add to my previous post, I installed "phpldapadmin" by enabling epel in the yum command as;
yum --enablerepo=epel install phpldapadmin

Thanks,
-Bijit Bhattacharjee

Bijit -

that comment was extremely helpful. Ive been banging my head against the wall trying to get yum to see that the repo had been installed!

thank you

-jf

You are welcome !!

Thanks,
-Bijit Bhattacharjee

@dr.light, You are welcome :-)

epel-release-6-8 has just been released, the URL in the example will need to be fixed again.

Thanks Anssi. We'll get the article updated.

Thanks. Now I can mount my usb hdd with 2 ntfs partitions on it to Centos and use Webmin File Manager module to copy my data from local disk to usb disk with few tasks.
Again, thanks!

hey friends i tried all this command in terminal but i alwaye fail how to solve this problem.......

[root@localhost ~]# yum update
There was a problem importing one of the Python modules
required to run yum. The error leading to this problem was:

No module named tempfile

Please install a package which provides this module, or
verify that the module is installed correctly.

It's possible that the above module doesn't match the
current version of Python, which is:
2.6.6 (r266:84292, Sep 11 2012, 08:34:23)
[GCC 4.4.6 20120305 (Red Hat 4.4.6-4)]

If you cannot solve this problem yourself, please go to
the yum faq at:
http://yum.baseurl.org/wiki/Faq


[root@localhost ~]# ^C
[root@localhost ~]#
if possible then send me link or call me at -***

Hi Akhilesh. Have you customized your python install in any way, or are you running two versions on your system? It sounds like python is having trouble finding its standard modules. It would look for them in the directory specified in $PYTHONPATH, as described in the python documentation:

http://docs.python.org/2/using/cmdline.html#environment-variables

The PYTHONPATH variable might be getting modified to point to a user directory without including the standard module directory. You could try setting it before running yum to see if that helps at all:

export PYTHONPATH=/usr/lib/python2.6/site-packages

Hope that gets you started in the right direction, at least.

You've put the 32 bit version for centos 5.x and the 64 bit version for 6.x.

Thanks for catching that Mark. I've made both links 64-bit and tried to make that more clear in the text.

[root@test3 storage]# yum --enablerepo=epel install heartbeat
Loaded plugins: downloadonly, rhnplugin, security
This system is not registered with RHN.
RHN support will be disabled.
http://ftp.tsukuba.wide.ad.jp/Linux/fedora/epel/5/x86_64/repodata/42d78718d550962719042c3b3f6c23ac12057b7b-primary.sqlite.bz2: [Errno 14] HTTP Error 404: Not Found
Trying other mirror.
http://mirror.nus.edu.sg/Fedora/epel/5/x86_64/repodata/42d78718d550962719042c3b3f6c23ac12057b7b-primary.sqlite.bz2: [Errno 14] HTTP Error 404: Not Found
Trying other mirror.
http://ftp.neowiz.com/fedora-epel/5/x86_64/repodata/42d78718d550962719042c3b3f6c23ac12057b7b-primary.sqlite.bz2: [Errno 14] HTTP Error 404: Not Found
Trying other mirror.
http://mirrors.ispros.com.bd/fedora-epel/5/x86_64/repodata/42d78718d550962719042c3b3f6c23ac12057b7b-primary.sqlite.bz2: [Errno 14] HTTP Error 404: Not Found
Trying other mirror.

Current download cancelled, interrupt (ctrl-c) again within two seconds to exit.

http://mirror.nus.edu.sg/fedora/epel/5/x86_64/repodata/42d78718d550962719042c3b3f6c23ac12057b7b-primary.sqlite.bz2: [Errno 14] HTTP Error 404: Not Found
Trying other mirror.
Error: failure: repodata/42d78718d550962719042c3b3f6c23ac12057b7b-primary.sqlite.bz2 from epel: [Errno 256] No more mirrors to try.
[root@test3 storage]# vi /etc/yum.repos.d/remi.repo
[root@test3 storage]#

I found someone who had a similar problem to you here:

http://hobodave.com/2011/02/10/fixing-epel-primary-sqlite-database-not-found/

He found that the mirror yum was selecting was out-of-date and not synced with the current EPEL contents, and had to exclude it manually. Basically he ran this before yum:

export URLGRABBER_DEBUG=1,-

Then ran the attempt to install. He looked for the mirror that was being used, then edited this file:

/etc/yum/pluginconf.d/fastestmirror.conf

And added the mirror that gave the error to the "exclude" setting.

im using centos6

in the below which should i edit and how to finish the process


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

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

[remi-debuginfo]
name=Les RPM de remi pour Enterprise Linux 6 - $basearch - debuginfo
baseurl=http://rpms.famillecollet.com/enterprise/6/debug-remi/$basearch/
enabled=0
gpgcheck=1
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-remi

-- INSERT -- 1,1 Top

What you've posted looks correct for the remi repository, though if that "-- INSERT -- 1,1 Top" line is indeed at the end, remove that. Otherwise you're good - only enable the "[remi]" part of the file by setting "enabled" in that section to "1", which you've done.

Do you get an error of any sort when you run "sudo yum update"?

thanks ,i done it..
can u tel how to install eucalyptus tool in centos..

I haven't worked with Eucalyptus myself, but on their website they include instructions for a CentOS 6 install:

http://www.eucalyptus.com/docs/3.2/ig/installing_euca_release.html

Hopefully that should do the trick.

thank you:) i have, but it is so complex....if u get any, just post it or sent to me..

sir ,,i have done what u said,,but again i am gettin the error as
"package epel-release-6-7-noarch.rpm is not installed"

wht should i do,,, to overcome this:)

Hm, the latest RPM is version 6.8, and they don't keep older versions of the repo's RPM on their server. Is it the Eucalyptus installer asking for that? If so, you might see if there's a newer version of the installer that would look for 6.8. Failing that, check the installer archive. If they have the 6.7 version of the EPEL RPM there, uninstall the 6.8 RPM and install that 6.7 version instead.

On second thought, my mistake. I replied without reading the full command you'd used.

The "-qi" options to the rpm command would ask whether the RPM is installed. Instead you should use:

yum install <rpmname>

Or you can use:

rpm -Uvh <rpmname>

Either of those should install the RPM without issue.

what's the use of "sudo yum update"

The yum utility is like a more capable, user-friendly rpm command. Use "sudo" to run commands that require superuser privileges when you aren't running as root (which is usually safer, from a security perspective). The "yum update" will tell the system to check its repositories for any packages with newer versions than what you currently have installed on your system.

I have installed, tks for this post, its helpful

thanks, it is working

Worked great! thanks a ton.

root@centos01 ~]# sudo yum update
Loaded plugins: aliases, changelog, downloadonly, fastestmirror, kabi, presto, refresh-packagekit,
: security, tmprepo, verify, versionlock
Loading support for CentOS kernel ABI
Loading mirror speeds from cached hostfile
Error: Cannot retrieve metalink for repository: epel. Please verify its path and try again

A variety of things might cause that error, but the simplest approach to try and resolve it is to uninstall then reinstall the epel RPM. Run:

sudo yum remove epel-release

Then run a yum update to make sure the error goes away:

sudo yum update

Then if all went well, run the epel install again:

sudo yum install epel-release-6*.rpm

If you can't run a yum update after that then there may be an issue with the date on the server (which could cause problems when it tries to verify the repo certificate).

after i installed the epel i got error message:'cannot retrieve reposistory metadata (repomd.xml) for reposistory:epel.."

would anyone help out

Thanks

Poking around some, I see that error crops up if you're behind a proxy server. Since the EPEL repo requires https, if you're behind a proxy you may need to follow these instructions:

http://mycodenotes.wordpress.com/2011/12/22/resolving-cannot-retrieve-repository-metadata-repomd-xml-for-repository-epel-please-verify-its-path-and-try-again/

[root@rpidvoproxy rpidavao]# wget http://dl.fedoraproject.org/pub/epel/6/x86_64/epel-release-6-8.noarch.rpm
--2013-05-07 16:06:55-- http://dl.fedoraproject.org/pub/epel/6/x86_64/epel-release-6-8.noarch.rpm
Resolving dl.fedoraproject.org... 209.132.181.27, 209.132.181.23, 209.132.181.24, ...
Connecting to dl.fedoraproject.org|209.132.181.27|:80... connected.
HTTP request sent, awaiting response... 200 OK
Length: 14540 (14K) [application/x-rpm]
Saving to: “epel-release-6-8.noarch.rpm”

100%[================================================================================>] 14,540 57.1K/s in 0.2s

2013-05-07 16:07:01 (57.1 KB/s) - “epel-release-6-8.noarch.rpm” saved [14540/14540]


[root@rpidvoproxy rpidavao]# wget http://rpms.famillecollet.com/enterprise/remi-release-6.rpm
--2013-05-07 16:07:30-- 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: 5420 (5.3K) [application/x-rpm]
Saving to: “remi-release-6.rpm”

100%[================================================================================>] 5,420 14.0K/s in 0.4s

2013-05-07 16:07:36 (14.0 KB/s) - “remi-release-6.rpm” saved [5420/5420]

[root@rpidvoproxy rpidavao]# sudo rpm -Uvh remi-release-6*.rpm epel-release-6*.rpm
Preparing... ########################################### [100%]
package epel-release-6-8.noarch is already installed
package remi-release-6-2.el6.remi.noarch is already installed
[root@rpidvoproxy rpidavao]# $ ls -1 /etc/yum.repos.d/epel* /etc/yum.repos.d/remi.repo
bash: $: command not found
[root@rpidvoproxy rpidavao]# ls -1 /etc/yum.repos.d/epel* /etc/yum.repos.d/remi.repo
ls: cannot access /etc/yum.repos.d/epel*: No such file or directory
ls: cannot access /etc/yum.repos.d/remi.repo: No such file or directory
[root@rpidvoproxy rpidavao]#



Hi, what happen in my repo file? no remi and epel... how to fix this?

Honestly, I think you might want to try removing what packages the system thinks are already installed, then reinstall the newer ones. Run:

yum remove epel-release remi-release

Once that removes the old packages install the new ones by repeating the rpm command:

sudo rpm -Uvh remi-release-6*.rpm epel-release-6*.rpm

Hopefully that will clear up the issues and get the proper repo descriptions into /etc/yum.repos.d.

Add new comment