How to install and use the EPEL repository for CentOS 5 and CentOS 6

Want to help support this blog? Try out Oh Dear, the best all-in-one monitoring tool for your entire website, co-founded by me (the guy that wrote this blogpost). Start with a 10-day trial, no strings attached.

We offer uptime monitoring, SSL checks, broken links checking, performance & cronjob monitoring, branded status pages & so much more. Try us out today!

Profile image of Mattias Geniar

Mattias Geniar, June 27, 2012

Follow me on Twitter as @mattiasgeniar

If you’re missing a few basic packages from the default CentOS repositories, it may be a good idea to install the EPEL (Extra Packages for Enterprise Linux) repository. The packages inside that repository aim to be compatible with the base packages provided by Red Hat Enterprise Linux (RHEL) and CentOS, so the most common of the Enterprise Linux’s out there.

To install the EPEL repository, issue the following commands as the root user from the command line.

Installing the EPEL repository

For CentOS 5

# rpm -Uvh 'http://dl.fedoraproject.org/pub/epel/5/i386/epel-release-5-4.noarch.rpm'

While the command above shows i386 in the URL name, it’s a version that is actually ‘noarch’ – meaning it works for i386, i686 and x86_64.

For CentOS 6

# rpm -Uvh 'http://dl.fedoraproject.org/pub/epel/6/i386/epel-release-6-7.noarch.rpm'

The same as the CentOS 5 install, while the download URL displays i386, it’s compatible with i386, i686 and x86_64.

Using the EPEL repository

Installing is one thing, using the repository is the next logical step. To get started, first verify a few things.

# yum clean all
# yum repolist
Loaded plugins: fastestmirror
Loading mirror speeds from cached hostfile
...
epel                 Extra Packages for Enterprise Linux 5 - i386                 5,736
...
repolist: 9,370

The yum repolist will show you that the EPEL repository has 5,736 packages available. If you simply run a “yum install package", it will automatically use that repository if it contains the latest version.

To update your system with the latest packages from the EPEL repository, it’s sufficient to run a “yum update".



Want to subscribe to the cron.weekly newsletter?

I write a weekly-ish newsletter on Linux, open source & webdevelopment called cron.weekly.

It features the latest news, guides & tutorials and new open source projects. You can sign up via email below.

No spam. Just some good, practical Linux & open source content.