This article discusses the automated way of installing the EPEL repository in CentOS.
Overview
EPEL (Extra Packages for Enterprise Linux) is a Fedora-maintained yum repository with additional packages for Enterprise Linux releases like Red Hat Enterprise Linux (RHEL), CentOS, and Oracle Linux.
YUM (Yellowdog Updater Modified) is a package management utility used by CentOS, RHEL, and Fedora Linux distributions. A YUM repository is a collection of software packages hosted locally or on remote servers. YUM is based on RPM manager, consisting of a set of Python language libraries.
YUM Repository configuration file structure
CentOS Linux yum repository configuration is found under /etc. yum. repos.d/:
[root@myvpsie ~]# ls /etc/yum.repos.d/
CentOS-Base.repo CentOS-Debuginfo.repo CentOS-Sources.repo CentOS-Vault.repo
Each repository is defined as a set of parameters in a file with the .repo extension.
Inside each .repo file, the following directives define the repository>
[repository-id] (mandatory) This represents the unique ID of the warehouse.
Name (mandatory)The readable name of the repository.
baseurl (mandatory) Defines the channel address that can be a file, FTP, HTTP, or HTTPS Address.
They are enabled “1” or “0”. If set to “1”, yum is allowed to use the channel.
Check Enables or disables GPG signature for the repository.
gpgkey Address of the GPG public key file.
EPEL repository
There is a way to install the EPEL repository in CentOS Linux without constructing the configuration file manually. This is because the configuration file is included in the CentOS base yum storage:
[root@myvpsie ~]# yum search epel
Failed to set locale, defaulting to C
Loaded plugins: fastestmirror
Loading mirror speeds from cached hostfile
* base: mirrors.advancedhosters.com
* extras: mirror.trouble-free.net
* updates: mirrors.advancedhosters.com
====================================================================== N/S matched: epel =======================================================================
epel-release.noarch : Extra Packages for Enterprise Linux repository configuration
Installing EPEL repository in CentOS
[root@myvpsie ~]# yum install epel-release
Failed to set locale, defaulting to C
Loaded plugins: fastestmirror
Loading mirror speeds from cached hostfile
* base: mirrors.advancedhosters.com
* extras: mirror.trouble-free.net
* updates: mirrors.advancedhosters.com
Resolving Dependencies
--> Running transaction check
---> Package epel-release.noarch 0:7-5 will be installed
--> Finished Dependency Resolution
Dependencies Resolved
================================================================================================================================================================
Package Arch Version Repository Size
================================================================================================================================================================
Installing:
epel-release noarch 7-5 extras 14 k
Transaction Summary
================================================================================================================================================================
Install 1 Package
Total download size: 14 k
Installed size: 24 k
Is this ok [y/d/N]: y
Downloading packages:
warning: /var/cache/yum/x86_64/7/extras/packages/epel-release-7-5.noarch.rpm: Header V3 RSA/SHA256 Signature, key ID f4a80eb5: NOKEY
Public key for epel-release-7-5.noarch.rpm is not installed
epel-release-7-5.noarch.rpm | 14 kB 00:00:00
Retrieving key from file:///etc/pki/rpm-gpg/RPM-GPG-KEY-CentOS-7
Importing GPG key 0xF4A80EB5:
Userid : "CentOS-7 Key (CentOS 7 Official Signing Key) <[email protected]>"
Fingerprint: 6341 ab27 53d7 8a78 a7c2 7bb1 24c6 a8a7 f4a8 0eb5
Package : centos-release-7-0.1406.el7.centos.2.3.x86_64 (@anaconda)
From : /etc/pki/rpm-gpg/RPM-GPG-KEY-CentOS-7
Is this ok [y/N]: y
Running transaction check
Running transaction test
Transaction test succeeded
Running transaction
Installing : epel-release-7-5.noarch 1/1
Verifying : epel-release-7-5.noarch 1/1
Installed:
epel-release.noarch 0:7-5
Complete!
The output shows there are two prompts requiring human input. First, one confirms installing the “epel-release” package, and the other confirm installing the GPG key for the epel repository.
Once done, EPEL repository header files must be downloaded to local directories. This is done automatically by YUM the next time it is executed:
[root@myvpsie ~]# yum search something
Failed to set locale, defaulting to C
Loaded plugins: fastestmirror
epel/x86_64/metalink | 14 kB 00:00:00
epel | 4.4 kB 00:00:00
(1/2): epel/x86_64/group_gz | 250 kB 00:00:00
(2/2): epel/x86_64/primary_db | 3.9 MB 00:00:03
(1/2): epel/x86_64/updateinfo | 280 kB 00:00:00
(2/2): epel/x86_64/pkgtags | 1.3 MB 00:00:02
Loading mirror speeds from cached hostfile
* base: mirrors.advancedhosters.com
* epel: mirrors.einstein.yu.edu
* extras: mirror.trouble-free.net
* updates: mirrors.advancedhosters.com
==================================================================== N/S matched: something ====================================================================
nagios.x86_64 : Nagios monitors hosts and services and yells if somethings breaks
perl-asa.noarch : Lets your class/object say it works like something else
Verify EPEL repository was installed on the disk
Once it has been installed, it will install a .repo configuration file in /etc/yum.repos.d:
[root@myvpsie ~]# ls -la /etc/yum.repos.d/
total 32
drwxr-xr-x. 2 root root 4096 Feb 12 17:13 .
drwxr-xr-x. 73 root root 4096 Feb 12 16:14 ..
-rw-r--r--. 1 root root 1612 Jul 4 2014 CentOS-Base.repo
-rw-r--r--. 1 root root 640 Jul 4 2014 CentOS-Debuginfo.repo
-rw-r--r--. 1 root root 1331 Jul 4 2014 CentOS-Sources.repo
-rw-r--r--. 1 root root 156 Jul 4 2014 CentOS-Vault.repo
-rw-r--r--. 1 root root 1056 Nov 25 11:23 epel-testing.repo
-rw-r--r--. 1 root root 957 Nov 25 11:23 epel.repo
[root@myvpsie ~]# cat /etc/yum.repos.d/epel.repo
[epel]
name=Extra Packages for Enterprise Linux 7 - $basearch
#baseurl=http://download.fedoraproject.org/pub/epel/7/$basearch
mirrorlist=https://mirrors.fedoraproject.org/metalink?repo=epel-7&arch=$basearch
failovermethod=priority
enabled=1
gpgcheck=1
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-EPEL-7
[epel-debuginfo]
name=Extra Packages for Enterprise Linux 7 - $basearch - Debug
#baseurl=http://download.fedoraproject.org/pub/epel/7/$basearch/debug
mirrorlist=https://mirrors.fedoraproject.org/metalink?repo=epel-debug-7&arch=$basearch
failovermethod=priority
enabled=0
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-EPEL-7
gpgcheck=1
[epel-source]
name=Extra Packages for Enterprise Linux 7 - $basearch - Source
#baseurl=http://download.fedoraproject.org/pub/epel/7/SRPMS
mirrorlist=https://mirrors.fedoraproject.org/metalink?repo=epel-source-7&arch=$basearch
failovermethod=priority
enabled=0
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-EPEL-7
gpgcheck=1
As expected, the EPEL yum repository is installed, enabled, and ready for use.
You can try those repo steps on our platform in a few minutes utilizing our PCS (Private Cloud Solution), which allows you to have VPSie(s) on a private network – NAT – Port forward – traffic control for inbound and outbound – multiple gateway IPs which you could use for the load-balancing and failover.
FAQ
The EPEL (Extra Packages for Enterprise Linux) yum repository is a community-driven repository of additional software packages for Red Hat Enterprise Linux (RHEL)
Installing the EPEL repository can provide access to many additional software packages that are not available in the default CentOS repository.
You can install the EPEL repository on your CentOS system by following these steps:
- Open the Terminal application on your CentOS system.
- Download the appropriate EPEL repository package for your CentOS version from the EPEL website: https://fedoraproject.org/wiki/EPEL#Quickstart
- Install the EPEL repository package by running the command: sudo rpm -ivh epel-release-*.rpm
You can verify that the EPEL repository is installed and enabled on your CentOS system by running the command: yum repolist
To disable the EPEL repository, open the configuration file at /etc/yum.repos.d/epel.repo and change the enabled parameter to 0. To remove the EPEL repository, run the command: sudo rpm -e epel-release.
To disable the EPEL repository, open the configuration file at /etc/yum.repos.d/epel.repo and change the enabled parameter to 0. To remove the EPEL repository, run the command: sudo rpm -e epel-release.
Yes, the EPEL repository is available for Fedora and CentOS, and RHEL systems.
No, the EPEL repository is a community-driven project not maintained by Red Hat or CentOS. However, it is supported by the CentOS community and is often recommended as a source of additional software packages.