Summary

In this tutorial we will learn,how to install EPEL repo in CentOS 5.x , 6.x / RHEL 5.x, 6.x / Scientific Linux. EPEL stands for Extra Packages for Enterprise Linux which is a repository of Red Hat based packages.EPEL repository is part of fedora project supported by volunteers and contributers.You can know more about EPEL from these links – EPEL’s Wiki> and FAQ

EPEL Repo Download Link: http://dl.fedoraproject.org/pub/epel/
Note: The URL of download link can be changed by Fedora’s EPEL team.If you find the URL is not working,we suggest you to find the new URL from the Wiki page

When you open this link you will see Version number,RPM GPG key etc. You have to select the version number of your operating system (for CentOS/Scientific Linux/Red Hat) eg. CentOS 6.5,Redhat 6.5 etc.

EPEL fedora CentOS RedHat


Note: Screenshot is taken on Jan-03-2014. Fedora’s EPEL team regularly do the changes in EPEL repo hence the list might not be same as given in screenshot in future.

From the download link,click on Version number and then click on directory showing your Operating System architecture.(use command arch to know about your O.S architecture).
After this you will see list of many rpm file. Search for rpm file having prefix epel .By this way you will get latest epel rpm package and you have to this new package to install.

Important Note: We are doing this practical today hence the epel rpm package version is epel-release-6-8.noarch.rpm . Replace the package name in given below tutorial with latest one.

Download and Install EPEL repo in CentOS 6.x/Red Hat 6.x/Scientific Linux 6.x

In this practical we have x86_64 CentOS 6.5 . Replace the x86_64 with your architecture which is available in EPEL repo link.

yum install wget
wget dl.fedoraproject.org/pub/epel/6/x86_64/epel-release-6-8.noarch.rpm
rpm -ivh epel-release-6-8.noarch.rpm

 

Download and Install EPEL repo in CentOS 5.x/Red Hat 5.x/Scientific Linux 5.x

In this practical we have x86_64 CentOS 5.8 . Replace the x86_64 with your architecture which is available in EPEL repo link.

yum install wget
dl.fedoraproject.org/pub/epel/5/x86_64/epel-release-5-4.noarch.rpm
rpm -ivh epel-release-5-4.noarch.rpm

Frequently Asked Question

Question: Where is the EPEL repo file got created ?

Answer: You can find the two epel repo files in /etc/yum.repos.d.
See the below screenshot.

EPEL

Question: How to enable EPEL repo ?

Answer: By-default the EPEL main repo is enabled. You can find enable and other options to enable in files called /etc/yum.repos.d/epel.repo and /etc/yum.repos.d/epel-testing.repo

for eg. in below content, you can see enabled value, if it is 1 ,it means the EPEL repo is enabled. And 0 means disabled

[root@localhost ~]# cat /etc/yum.repos.d/epel.repo 
[epel]

name=Extra Packages for Enterprise Linux 6 – $basearch #baseurl=http://download.fedoraproject.org/pub/epel/6/$basearch mirrorlist=https://mirrors.fedoraproject.org/metalink?repo=epel-6&arch=$basearch failovermethod=priority enabled=1 gpgcheck=1 gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-EPEL-6

[epel-debuginfo]

name=Extra Packages for Enterprise Linux 6 – $basearch – Debug #baseurl=http://download.fedoraproject.org/pub/epel/6/$basearch/debug mirrorlist=https://mirrors.fedoraproject.org/metalink?repo=epel-debug-6&arch=$basearch failovermethod=priority enabled=0 gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-EPEL-6 gpgcheck=1

[epel-source]

name=Extra Packages for Enterprise Linux 6 – $basearch – Source #baseurl=http://download.fedoraproject.org/pub/epel/6/SRPMS mirrorlist=https://mirrors.fedoraproject.org/metalink?repo=epel-source-6&arch=$basearch failovermethod=priority enabled=0 gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-EPEL-6 gpgcheck=1 [root@localhost ~]

Question: How may I list all available packages in EPEL repo

Answer: Use the given below command

yum --disablerepo="*" --enablerepo="epel" list available

Question: How can I disable other repo and enable only epel repo to install package

Answer: As per yum --help command.
Use the below given options.

--enablerepo=[repo]   enable one or more repositories (wildcards allowed)
--disablerepo=[repo]  disable one or more repositories (wildcards allowed)

As per the question,you have to write the command. Replace package-name with actual name of package.

yum update
yum --disablerepo="*" --enablerepo="epel" package-name

Note: With the combination of --disablerepo="*" --enablerepo="epel" you can also use other yum options.

Question: Why you writing only epel keyword in --enablerepo="epel". From where you found this keyword.

Answer: It is name of repo which is mentioned in epel.repo file. The repo name is given in square brackets eg. [epel ] .

Read Some More Articles

Leave a Reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.