How To Enable and Install EPEL Repo on CentOS 8.x

last updated in Categories , ,

How do I install the extra repositories such as Fedora EPEL repo on a CentOS Enterprise Linux server version 8.x? How to enable EPEL repo on CentOS 8.x?

Introduction – You can easily install various packages by configuring a CentOS 8.x system to use Fedora EPEL 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.

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. Or login to an CentOS 8.x host called server1 using ssh user@centos8-box-name command.
  3. Log in as root user using the [n
  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
epel-release.noarch : Extra Packages for Enterprise Linux repository configuration

To get more info, run:
yum info epel-release
Sample outputs:

Available Packages
Name         : epel-release
Version      : 8
Release      : 5.el8
Arch         : noarch
Size         : 22 k
Source       : epel-release-8-5.el8.src.rpm
Repo         : 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
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
Now that EPEL repo installed it is time to configure and use it. Hence, run the following command:
sudo yum 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

Enable and Install EPEL Repo with verification on CentOS Linux 8
Verification and listing EPEL repo

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 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 '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 yum our 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.

Posted by: Vivek Gite

The author is the creator of nixCraft and a seasoned sysadmin, DevOps engineer, and a trainer for the Linux operating system/Unix shell scripting. Get the latest tutorials on SysAdmin, Linux/Unix and open source topics via RSS/XML feed or weekly email newsletter.

Start the discussion at www.nixcraft.com

Historical Comment Archive

1 comment

    Still, have a question? Get help on our forum!