We can easily enable the EPEL repository. However, the enabling process might differ depending on the OS.
Here at Bobcares, we have seen several such CentOS related installations as part of our Server Management Services for web hosts and online service providers.
Today we’ll take a look at how to enable EPEL.
A few facts about EPEL
EPEL repository provides an easy access to install packages for commonly used software. Also. this repo was mainly created to provide greater ease of access to software on Enterprise Linux compatible distributions.
EPEL Repo provides many open source packages to install via Yum and DNF. Moreover, it is 100% open source and free to use. Also, it doesn’t provide any core duplicate packages and no compatibility issues.
We can use the EPEL repository with the below Linux Distributions:
- Red Hat Enterprise Linux (RHEL)
- CentOS
- Scientific Linux
- Oracle Linux
How we enable EPEL repository
The enabling process of the EPEL repository might differ depending on the OS that you are using.
Now let’s take a look at how our Support Engineers enable it on CentOS.
Installing EPEL on CentOS via yum
By default, the CentOS distribution includes a repo called ‘CentOS Extras’.
First, connect to the server via SSH as the root user or you can also open terminal if you are working locally.
Here is the command we run to install the EPEL repository.
$ sudo yum install epel-release
Now, you will receive a confirmation dialog, hit enter, and confirm the installation.
Installing EPEL on RHEL/CentOS/etc
In case, if you are running a different distribution then you can install the EPEL repo following the below method.
As a first step, run the below command.
$ cd /tmp
Next, download the rpm file for installation. However, the file download will depend on the OS that you are using. Select the one you are using from the list below.
- RHEL 7/CentOS 7/etc:
$ wget https://dl.fedoraproject.org/pub/epel/epel-release-latest-7.noarch.rpm
- The RHEL 6/CentOS 6/etc:
$ wget https://dl.fedoraproject.org/pub/epel/epel-release-latest-6.noarch.rpm
- RHEL 5/CentOS 5/etc:
$ wget https://dl.fedoraproject.org/pub/epel/epel-release-latest-5.noarch.rpm
After downloading the EPEL rpm file for your OS version, you can now install the EPEL repository. For that, run the below command.
$ yum install ./epel-release-latest-*.noarch.rpm
Next, search and install the package. To list all available packages under a repo called EPEL, enter:
$ sudo yum –disablerepo=”*” –enablerepo=”epel” list available
OR
$ sudo yum –disablerepo=”*” –enablerepo=”epel” list available | grep ‘package’
OR
$ sudo yum –disablerepo=”*” –enablerepo=”epel” list available | less
How to Use EPEL Repository to Install Packages
After the successful installation of the EPEL repository, we can install a package using the command.
$ sudo dnf –enablerepo=”epel” install <package_name>
OR
$ sudo yum –enablerepo=”epel” install <package_name>
Let’s see an example where we search and install a package called htop.
Here is the command to find the package info.
$ sudo yum –enablerepo=epel info htop
Now, we run the below command to install htop.
$ sudo yum –enablerepo=epel install htop
The EPEL configuration file is located under /etc/yum.repos.d/epel.repo.
[Need any further assistance with CentOS queries? – We are here to help you.]
Conclusion
In short, we can enable EPEL repo on different Linux distributions. Also, today we saw how our Support Engineers it on CentOS via yum and on RHEL/CentOS/etc. Also, we saw how to use EPEL Repo to Install Packages.
0 Comments