28.2 C
Senior Writer and partner

How to enable The EPEL repository on CentOS 6, 7 ?

CentOS is a large GNU/LINUX distribution oriented for use on servers. Based on and compatible with Red Hat Enterprise Linux, it is well known and popular with system administrators thanks to its strong security policies and above all for its robustness and stability. However, it does not always have a complete package and must resort to external repositories in order to have the advanced software. The EPEL repository contains packages absolutely compatible with CentOS bringing it more flexibility and possibilities.

It provides a good amount of updated and stable packages ready to be installed in CentOS.

The main advantages of using this repository are:

  • Provides updated packages easily installable via YUM.
  • It is a reliable and secure repository. Maintained by Fedora repo.
  • It provides us with packages that are not in the official CENTOS or RHEL repositories.
  • Built with open source tools.

Enabling the EPEL repository

For RHEL and CentOS 7 64bits

In order to achieve the goal, the first thing you must do to enable the EPEL repository is to have root user privileges, so write to a terminal:

- Advertisement -
:~$ su

1.- Logging as root user
1.- Logging as root user

After you have set your root password, you can continue with the repository enable.

Next, you must make sure to have wget installed, which is a utility to download files from the terminal.

:~# yum install wget



2.- Installing wget from terminal
2.- Installing wget from the terminal

Once you are sure you have wget installed, you can download the.rpm package that configures the repository. Run,

:~# wget http://dl.fedoraproject.org/pub/epel/epel-release-latest-7.noarch.rpm

3.- Downsloading package for EPEL repository
3.- Downloading package for EPEL repository

Once the package has been downloaded, install it.

:~# rpm -ivh epel-release-latest-7.noarch.rpm

4.- Installing downloaded package
4.- Installing downloaded package

For RHEL and CentOS 6 64bits

For the previous version, i.e. CentOS 6, the process is similar. First, make sure you have wget:

:~# yum install wget

And then, proceed to download the specific package for this version.

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

And finally, proceed to install it as a .rpm package.

:~# rpm -ivh epel-release-6-8.noarch.rpm

That’s it.

Verifying the repository was added correctly

If the installation went well, you should have the repository added correctly but you can prove it. Type the following command to do this:

:~# yum repolist

5.- Running yum repolist
5.- Running yum repolist

Now, you can say that the repository was successfully added.

Using EPEL on CentOS 7

To use the EPEL repository, you must use YUM, and you can search for a package if it is available within that repository. I will use the nagios package as an example.

:~# yum --enablerepo=epel info nagios

6.- Showing information package from EPEL repository
6.- Showing information package from EPEL repository

And if you wanted to install it, you would use the following command:

:~# yum --enablerepo=epel install nagios

7.- Installing a package from EPEL repository
7.- Installing a package from EPEL repository

Adding the EPEL repository in our CentOS or RHEL is of vital importance because of the number of packages they have, and even more, updated than those that come by default in the official repositories.

Tell us about your experience with CentOS and the EPEL repository?

Please share this post with your friends.


- Advertisement -
Everything Linux, A.I, IT News, DataOps, Open Source and more delivered right to you.
"The best Linux newsletter on the web"


Please enter your comment!
Please enter your name here

Latest article