How to enable yum repository on RHEL and CentOS 7/6/5/4

Since the red hat enterprise linux is a commercial version of linux family, you need a valid support account to install packages through its repository. If you don't have valid support account from Red Hat then you can not install packages through its repository.

Unfortunately, RPMForge and RepoForge are no more available as stated on their official website so we will use extra packages enterprise linux (EPEL) an open source and free repository project from Fedora developers which provides software packages and dependencies for Linux distribution including Red Hat Enterprise Linux, CentOS, and Scientific Linux.

This Linux Guide will walk you through the steps to install and use yum repository on red hat and centos linux on different release.

Enabling Yum Repository in RHEL and CentOS 7/6/5/4

To begin, we need to install EPEL repository package from the following links. You must be a root user to install repository package using below links based on your Linux versions.

Check your linux operating system version using the following command.

uname -r

RHEL and CentOS 7 64 bit Repo

rpm -ivh

RHEL and CentOS 6 32-64 bit Repo

rpm -ivh
rpm -ivh

RHEL and CentOS 5 32-64 bit Repo

rpm -ivh
rpm -iv

RHEL and CentOS 4 32-64 bit Repo

rpm -ivh
rpm -ivh

Since we have installed repository package, now we need to execute the following command to verify epel repository is enabled or not.
# yum repolist
Loaded plugins: downloadonly, fastestmirror, priorities
Loading mirror speeds from cached hostfile
* base:
* epel:
* extras:
* rpmforge:
* updates:
Reducing CentOS-5 Testing to included packages only
1469 packages excluded due to repository priority protections
repo id                           repo name                                                      status
base                              CentOS-5 - Base                                               2,718+7
epel Extra Packages for Enterprise Linux 5 - i386 4,320+1,408
extras                            CentOS-5 - Extras                                              229+53
rpmforge                          Red Hat Enterprise 5 - - dag                      11,251
repolist: 19,075
Our epel repository is available and enabled. Lets search and install packages through it. For instance, we will search for Zabbix package.
# yum --enablerepo=epel info zabbix
Available Packages
Name       : zabbix
Arch       : i386
Version    : 1.4.7
Release    : 1.el5
Size       : 1.7 M
Repo : epel
Summary    : Open-source monitoring solution for your IT infrastructure
URL        :
License    : GPL
Description: ZABBIX is software that monitors numerous parameters of a network.
Now we will install Zabbix package from epel repository with the following command
# yum --enablerepo=epel install zabbix
Through the above steps you can install as many repositories as you want on your Linux system.


We have demonstrated how to enable yum repository in red hat enterprise linux and CentOS. I hope this guide was helpful to install and enable repository on your linux machine.

No comments:

Powered by Blogger.