How To Install EPEL Repo on an RHEL 8

How do I install the extra repositories such as Fedora EPEL repo on an Red Hat Enterprise Linux server version 8?

You can easily install various packages by configuring an RHEL 8 system to use Fedora EPEL repos and third party packages. Please note that these packages are not officially supported by Red Hat, Inc, but provides many popular packages and apps. This quick tutorial explains how to configure a Red Hat Enterprise Linux (RHEL) version 8 to use the Fedora Extra Packages for Enterprise Linux (EPEL) repository.

Linux commands to install EPEL repo on an RHEL 8

The procedure to enable EPEL repository for an RHEL 8 server is as follows:

  1. Open a shell prompt.
  2. Or login to an RHEL 8.x host called server1 using ssh client.
  3. Install epel using the following command: yum -y install https://dl.fedoraproject.org/pub/epel/epel-release-latest-8.noarch.rpm
  4. Refresh repo by typing the following command: yum repolist

Let us see all commands and options in details.

You can use both the yum or dnf command. In fact, yum is soft linked to dnf, and it is kept for backward compatibility reasons on Red Hat Enterprise Linux 8.x.

Installing and enabling EPEL repo on an RHEL 8

The following instructions assumes that you are running command as root user on an RHEL 8.x system and want to use use Fedora Epel repository.

Install Extra Packages for Enterprise Linux repository configuration

Just type the following yum command on an RHEL 8:
sudo yum install https://dl.fedoraproject.org/pub/epel/epel-release-latest-8.noarch.rpm
Install EPEL Repo on an RHEL 8.x
Now that EPEL repo installed it is time to configure and use it. Hence, run the following command:
sudo yum update
Sample outputs:

Extra Packages for Enterprise Linux 8 - x86_64  198 kB/s | 430 kB     00:02    
Red Hat Update Infrastructure 3 Client Configur 1.8 kB/s | 2.1 kB     00:01    
Red Hat Enterprise Linux 8 for x86_64 - AppStre  25 MB/s | 8.6 MB     00:00    
Red Hat Enterprise Linux 8 for x86_64 - BaseOS   21 MB/s | 6.3 MB     00:00    
Dependencies resolved.
Nothing to do.
Complete!

Enable the codeready-builder-for-rhel-8-*-rpms repository

Since EPEL packages may depend on packages from codeready-builder-for-rhel-8-*-rpms, run:
sudo subscription-manager repos --enable "codeready-builder-for-rhel-8-*-rpms"

List your new repos

Let us list our new repo using the yum command. In other words type the following command:
sudo yum repolist

Last metadata expiration check: 0:01:36 ago on Thursday 15 August 2019 08:13:39 AM UTC.
repo id                           repo name                                                                 status
*epel                             Extra Packages for Enterprise Linux 8 - x86_64                              310
rhel-8-appstream-rhui-rpms        Red Hat Enterprise Linux 8 for x86_64 - AppStream from RHUI (RPMs)        5,739
rhel-8-baseos-rhui-rpms           Red Hat Enterprise Linux 8 for x86_64 - BaseOS from RHUI (RPMs)           2,097
rhui-client-config-server-8       Red Hat Update Infrastructure 3 Client Configuration Server 8                 3

How to search and install package from repo on Red Hat Enterprise Linux 8.x

One can list all available packages under a repo named epel by typing the following command:
$ sudo yum --disablerepo="*" --enablerepo="epel" list available
OR use the grep command to filter out package names:
$ sudo yum --disablerepo="*" --enablerepo="epel" list available | grep 'package'
$ sudo yum --disablerepo="*" --enablerepo="epel" list available | grep 'screen'

Here is the list:

Last metadata expiration check: 0:03:56 ago on Thursday 15 August 2019 08:13:35 AM UTC.
Available Packages
apachetop.x86_64                                             0.19.7-1.el8                                     epel
arj.x86_64                                                   3.10.22-30.el8                                   epel
beecrypt.x86_64                                              4.2.1-23.el8                                     epel
beecrypt-apidocs.x86_64                                      4.2.1-23.el8                                     epel
beecrypt-devel.x86_64                                        4.2.1-23.el8                                     epel
bgpdump.x86_64                                               1.6.0-2.el8                                      epel
bird.x86_64                                                  2.0.4-1.el8                                      epel
bird-doc.noarch                                              2.0.4-1.el8                                      epel
bodhi-client.noarch                                          4.0.2-2.el8.1                                    epel
bodhi-composer.noarch                                        4.0.2-2.el8.1                                    epel
bodhi-server.noarch                                          4.0.2-2.el8.1                                    epel
cc1541.x86_64                                                2.0-3.el8                                        epel
....
..
...
screen.x86_64                                                4.6.2-10.el8                                     epel
sendemail.noarch                                             1.56-4.el8                                       epel
sip-redirect.noarch                                          0.2.0-9.el8                                      epel
sshexport.noarch                                             2.4-1.el8                                        epel
tio.x86_64                                                   1.32-1.el8                                       epel
x509viewer.noarch                                            0.1.0-5.el8                                      epel
x509watch.noarch                                             0.6.1-6.el8                                      epel
zerofree.x86_64                                              1.1.1-3.el8                                      epel

Count packages

Use the following wc command to count packages:

echo -e "As of $(date) we have '$(sudo yum --disablerepo="*" --enablerepo="epel" list available | wc -l)' packages in this repo."

Which produces the following outputs on screen:

As of Mon Feb 15 00:27:19 EST 2021 we have '7006' packages in this repo.

Examples

For example, search a package named screen and install it on RHEL 8 using EPEL repo. The commands are as follows (see yum our command guide for more info).

Installing package using EPEL repo on RHEL 8

The syntax is as follows to search a package named screen:

## search it ##
sudo yum search screen

Next get more information about the screen:
sudo yum info screen

Finally, install the screen package on your Red Hat Enterprise Linux 8.x server or desktop/workstation system:
sudo yum install screen

Installing screen package on an RHEL 8 using epel repo command

Installing screen package on an RHEL 8 using yum command from epel repo

Conclusion

And, there you have it, a more significant number of packages to install from EPEL repo on Red Hat Enterprise Linux version 8.x. This repo gives us many high-quality free and open-source software packages that developers and uses can install on RHEL, CentOS, and Oracle Linux. Hence, we must enable it on a fresh installation. See repo home page here for more information.

This entry is 4 of 5 in the Enable EPEL Repository on a CentOS/RHEL Tutorial series. Keep reading the rest of the series:
  1. CentOS / RHEL / Scientific Linux 6/5 Enable and Install EPEL Repo
  2. How To Install EPEL Repo on a CentOS and RHEL 7.x
  3. yum command: Update / Install Packages Under Redhat Enterprise / CentOS Linux Version 5.x
  4. Install and enable EPEL repo on an RHEL 8.x
  5. CentOS 8 Install and enable EPEL repo

🐧 Get the latest tutorials on Linux, Open Source & DevOps via RSS feed or Weekly email newsletter.

🐧 3 comments so far... add one

CategoryList of Unix and Linux commands
Disk space analyzersncdu pydf
File Managementcat
FirewallAlpine Awall CentOS 8 OpenSUSE RHEL 8 Ubuntu 16.04 Ubuntu 18.04 Ubuntu 20.04
Network UtilitiesNetHogs dig host ip nmap
OpenVPNCentOS 7 CentOS 8 Debian 10 Debian 8/9 Ubuntu 18.04 Ubuntu 20.04
Package Managerapk apt
Processes Managementbg chroot cron disown fg jobs killall kill pidof pstree pwdx time
Searchinggrep whereis which
User Informationgroups id lastcomm last lid/libuser-lid logname members users whoami who w
WireGuard VPNAlpine CentOS 8 Debian 10 Firewall Ubuntu 20.04
3 comments… add one
  • shariq khan Nov 30, 2020 @ 15:32

    Dear Team,

    while downloading the epel repository in rhel 8, getting below error…

    [root@rhel-app1 modprobe.d]# yum -y install https://dl.fedoraproject.org/pub/epel/epel-release-latest-8.noarch.rpm

    Updating Subscription Management repositories.
    Unable to read consumer identity
    
    This system is not registered to Red Hat Subscription Management. You can use subscription-manager to register.
    
    Last metadata expiration check: 0:48:04 ago on Mon 30 Nov 2020 11:59:51 AM PST.
    [MIRROR] epel-release-latest-8.noarch.rpm: Curl error (6): Couldn't resolve host name for https://dl.fedoraproject.org/pub/epel/epel-release-latest-8.noarch.rpm [Could not resolve host: dl.fedoraproject.org]
    [MIRROR] epel-release-latest-8.noarch.rpm: Curl error (6): Couldn't resolve host name for https://dl.fedoraproject.org/pub/epel/epel-release-latest-8.noarch.rpm [Could not resolve host: dl.fedoraproject.org]
    [MIRROR] epel-release-latest-8.noarch.rpm: Curl error (6): Couldn't resolve host name for https://dl.fedoraproject.org/pub/epel/epel-release-latest-8.noarch.rpm [Could not resolve host: dl.fedoraproject.org]
    [MIRROR] epel-release-latest-8.noarch.rpm: Curl error (6): Couldn't resolve host name for https://dl.fedoraproject.org/pub/epel/epel-release-latest-8.noarch.rpm [Could not resolve host: dl.fedoraproject.org]
    [FAILED] epel-release-latest-8.noarch.rpm: Curl error (6): Couldn't resolve host name for https://dl.fedoraproject.org/pub/epel/epel-release-latest-8.noarch.rpm [Could not resolve host: dl.fedoraproject.org]
    Curl error (6): Couldn't resolve host name for https://dl.fedoraproject.org/pub/epel/epel-release-latest-8.noarch.rpm [Could not resolve host: dl.fedoraproject.org]
    

    Regards
    Shariq

    • 🐧 Vivek Gite Nov 30, 2020 @ 15:56

      Check your DNS name resolution. Can you ping or resolve hosts by names?

      host google.com
      ping yahoo.com

      If not set up correct nameservers names in /etc/resolv.conf. For example:

      # Generated by NetworkManager
      nameserver 192.168.2.250
      
    • Rohit Feb 23, 2021 @ 9:39

      You need to subscribe RHEL by paying or use devloper account to activate free subscription.

Leave a Reply

Your email address will not be published.

Use HTML <pre>...</pre> for code samples. Still have questions? Post it on our forum