How To Enable and Install EPEL Repo on CentOS 8

How do I install the Extra Packages for Enterprise Linux (EPEL), such as Fedora EPEL repo on a CentOS Enterprise Linux server version 8.x? How to enable EPEL repo on CentOS 8?

You can easily install various packages by configuring a CentOS 8.x system to use Fedora EPEL (Extra Packages for Enterprise Linux) repos and third party packages. This quick tutorial explains how to configure a CentOS Linux version 8.x to use the Fedora Extra Packages for Enterprise Linux (EPEL) repository.

ADVERTISEMENTS

Commands to install EPEL repo on a CentOS 8.x

The procedure to enable EPEL repository for a CentOS 8.x system is as follows:

  1. Open a shell prompt.
  2. Use ssh to log in to an CentOS 8.x host using ssh user@centos8-box-name command.
  3. Log in as root user using the su command/sudo command
  4. Install epel using the following command: sudo yum -y install epel-release
  5. Refresh repo by typing the following command: sudo yum repolist

Let us see all commands in details for CentOS server.

How to install EPEL repo on CentOS 8.x

The following instructions assumes that you are running command as root user on CentOS 8.x system and want to use use Fedora Epel repository. To switch to root user, run su command or sudo command:
su -
OR
sudo -i

How to search and enable the EPEL Repository on CentOS 8

Run the following command:
yum search epel
## OR ##
dnf search epel
epel-release.noarch : Extra Packages for Enterprise Linux repository configuration

To get more info, run:
yum info epel-release
## OR ##
dnf info epel-release

Sample outputs:

CentOS-8 - Base                                                                                                                                                                                                                                 4.3 kB/s | 3.9 kB     00:00    
CentOS-8 - Extras                                                                                                                                                                                                                               1.7 kB/s | 1.5 kB     00:00    
Available Packages
Name         : epel-release
Version      : 8
Release      : 8.el8
Architecture : noarch
Size         : 23 k
Source       : epel-release-8-8.el8.src.rpm
Repository   : extras
Summary      : Extra Packages for Enterprise Linux repository configuration
URL          : http://download.fedoraproject.org/pub/epel
License      : GPLv2
Description  : This package contains the Extra Packages for Enterprise Linux (EPEL) repository
             : GPG key as well as configuration for yum.

Install Extra Packages for CentOS Enterprise Linux repository configuration

Execute the following yum command on CentOS 8:
sudo yum install epel-release
## OR ##
sudo dnf install epel-release

Install EPEL Repo on CentOS 8.x using yum command
Finally, enable the PowerTools repository since EPEL packages may depend on packages from it:
sudo yum config-manager --set-enabled PowerTools
## OR ##
sudo dnf config-manager --set-enabled PowerTools

You may get an error that read as follows:

No such command: config-manager. Please use /usr/bin/yum –help

Run the following command to fix it:
sudo yum install 'dnf-command(config-manager)'
## OR ##
sudo dnf install 'dnf-command(config-manager)'

Sample outputs:

Last metadata expiration check: 0:02:33 ago on Sun Dec  8 03:17:00 2019.
Dependencies resolved.
=================================================================================================================
 Package                               Arch                Version                     Repository           Size
=================================================================================================================
Installing:
 dnf-plugins-core                      noarch              4.0.2.2-3.el8               BaseOS               59 k
Installing dependencies:
 python3-dateutil                      noarch              1:2.6.1-6.el8               BaseOS              251 k
 python3-dnf-plugins-core              noarch              4.0.2.2-3.el8               BaseOS              171 k
 
Transaction Summary
=================================================================================================================
Install  3 Packages
 
Total download size: 481 k
Installed size: 1.1 M
Is this ok [y/N]: y
Downloading Packages:
(1/3): dnf-plugins-core-4.0.2.2-3.el8.noarch.rpm                                 547 kB/s |  59 kB     00:00    
(2/3): python3-dnf-plugins-core-4.0.2.2-3.el8.noarch.rpm                         1.1 MB/s | 171 kB     00:00    
(3/3): python3-dateutil-2.6.1-6.el8.noarch.rpm                                   1.5 MB/s | 251 kB     00:00    
-----------------------------------------------------------------------------------------------------------------
Total                                                                            293 kB/s | 481 kB     00:01     
Running transaction check
Transaction check succeeded.
Running transaction test
Transaction test succeeded.
Running transaction
  Preparing        :                                                                                         1/1 
  Installing       : python3-dateutil-1:2.6.1-6.el8.noarch                                                   1/3 
  Installing       : python3-dnf-plugins-core-4.0.2.2-3.el8.noarch                                           2/3 
  Installing       : dnf-plugins-core-4.0.2.2-3.el8.noarch                                                   3/3 
  Running scriptlet: dnf-plugins-core-4.0.2.2-3.el8.noarch                                                   3/3 
  Verifying        : dnf-plugins-core-4.0.2.2-3.el8.noarch                                                   1/3 
  Verifying        : python3-dateutil-1:2.6.1-6.el8.noarch                                                   2/3 
  Verifying        : python3-dnf-plugins-core-4.0.2.2-3.el8.noarch                                           3/3 
 
Installed:
  dnf-plugins-core-4.0.2.2-3.el8.noarch                       python3-dateutil-1:2.6.1-6.el8.noarch              
  python3-dnf-plugins-core-4.0.2.2-3.el8.noarch              
 
Complete!

And re-run the above command again:
sudo yum config-manager --set-enabled PowerTools
## OR ##
sudo dnf config-manager --set-enabled PowerTools

Now that EPEL repo installed it is time to configure and use it. Hence, run the following command:
sudo yum update
## OR ##
sudo dnf update

Sample outputs:

CentOS-8 - AppStream                          570 kB/s | 4.3 kB     00:00    
CentOS-8 - Base                               553 kB/s | 3.8 kB     00:00    
CentOS-8 - Extras                             226 kB/s | 1.5 kB     00:00    
CentOS-8 - PowerTools                          54 MB/s | 1.8 MB     00:00    
Extra Packages for Enterprise Linux 8 - x86_6  52 kB/s |  21 kB     00:00    
Dependencies resolved.
Nothing to do.
Complete!

List your new repos

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

Enable and Install EPEL Repo with verification on CentOS Linux 8

Verification and listing EPEL repo

Count packages in EPEL repo

Run the following command along with wc command:
sudo yum --disablerepo="*" --enablerepo="epel" list available | wc -l
## OR ##
sudo dnf --disablerepo="*" --enablerepo="epel" list available | wc -l

Sample outputs:

5460

How to search and install package from EPEL repo on CentOS 8

One can list all available packages under a repo named epel by typing the following command:
sudo yum --disablerepo="*" --enablerepo="epel" list available
## OR ##
sudo dnf --disablerepo="*" --enablerepo="epel" list available

Alternatively, use the grep command/egrep command to filter out package names:
sudo yum --disablerepo="*" --enablerepo="epel" list available | grep 'package'
sudo yum --disablerepo="*" --enablerepo="epel" list available | grep 'openvpn'
## OR ##
sudo dnf --disablerepo="*" --enablerepo="epel" list available | grep 'package'
sudo dnf --disablerepo="*" --enablerepo="epel" list available | grep 'openvpn'

Outputs:

Last metadata expiration check: 0:05:11 ago on Thursday 26 September 2019 06:23:09 AM UTC.
Available Packages
BackupPC.x86_64                                    4.3.1-2.el8                             epel
BackupPC-XS.x86_64                                 0.59-3.el8                              epel
CGSI-gSOAP.x86_64                                  1.3.11-7.el8                            epel
CGSI-gSOAP-devel.x86_64                            1.3.11-7.el8                            epel
Field3D.x86_64                                     1.7.2-16.el8                            epel
Field3D-devel.x86_64                               1.7.2-16.el8                            epel
GraphicsMagick.x86_64                              1.3.33-1.el8                            epel
GraphicsMagick-c++.x86_64                          1.3.33-1.el8                            epel
zabbix40-server-mysql.x86_64                       4.0.11-2.el8                            epel
...
..
...
zabbix40-server-pgsql.x86_64                       4.0.11-2.el8                            epel
zabbix40-web.noarch                                4.0.11-2.el8                            epel
zabbix40-web-mysql.noarch                          4.0.11-2.el8                            epel
zabbix40-web-pgsql.noarch                          4.0.11-2.el8                            epel
zerofree.x86_64                                    1.1.1-3.el8                             epel
zimg.x86_64                                        2.8-4.el8                               epel
zimg-devel.x86_64                                  2.8-4.el8                               epel
zstd.x86_64                                        1.4.2-1.el8                             epel
zvbi.x86_64                                        0.2.35-9.el8                            epel
zvbi-devel.x86_64                                  0.2.35-9.el8                            epel
zvbi-fonts.noarch                                  0.2.35-9.el8                            epel

Examples

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

## search it ##
sudo yum search atop
 
## get more info about the atop, if found ##
sudo yum info atop
 
## install the same on CentOS box ##
sudo yum install atop
Installing atop package on a CentOS 8 using epel repo yum command

Conclusion

And, there you have it, a more significant number of packages to install from EPEL repo on CentOS Enterprise Linux version 8.x. See EPEL repo home page here for more information.

🐧 Get the latest tutorials on SysAdmin, Linux/Unix, Open Source/DevOps topics:
CategoryList of Unix and Linux commands
File Managementcat
FirewallCentOS 8 OpenSUSE RHEL 8 Ubuntu 16.04 Ubuntu 18.04 Ubuntu 20.04
Network Utilitiesdig 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 VPNCentOS 8 Debian 10 Firewall Ubuntu 20.04

ADVERTISEMENTS

Comments on this entry are closed.

Use HTML <pre>...</pre>, <code>...</code> and <kbd>...</kbd> for code samples.