![](/base_images/jeremy.jpg)
The dnf list or yum list command will the repositories you have installed at the beginning of the output. Notice that the EPEL (Extra Packages for Enterprise Linux) repository is not included in the output.
~]$ dnf list | head
* base: centos.mirrors.tds.net
* centos-sclo-rh: mirror.den01.meanservers.net
* centos-sclo-sclo: mirror.den01.meanservers.net
* extras: centos.mirrors.tds.net
* updates: mirror.genesishosting.com
Likewise, the dnf list installed or yum list installed command can be used to determine if EPEL is installed. If EPEL is not installed, nothing should be returned.
dnf list installed | grep -i epel
Or the dnf repolist or yum repolist command can be used.
dnf repolist | grep -i epel
And yet another way to know if EPEL is installed is to check the /etc/yum.repos.d directory. Notice in this example that the directory does not contain any EPEL files.
~]$ ll /etc/yum.repos.d/
-rw-r--r--. 1 root root 1664 Apr 7 2020 CentOS-Base.repo
-rw-r--r--. 1 root root 1309 Apr 7 2020 CentOS-CR.repo
-rw-r--r--. 1 root root 649 Apr 7 2020 CentOS-Debuginfo.repo
-rw-r--r--. 1 root root 314 Apr 7 2020 CentOS-fasttrack.repo
-rw-r--r--. 1 root root 630 Apr 7 2020 CentOS-Media.repo
-rw-r--r--. 1 root root 1331 Apr 7 2020 CentOS-Sources.repo
-rw-r--r--. 1 root root 7577 Apr 7 2020 CentOS-Vault.repo
-rw-r--r--. 1 root root 616 Apr 7 2020 CentOS-x86_64-kernel.repo
The dnf install or yum install command can be used to install EPEL.
dnf install epel-release
Or like this (CentOS 7).
dnf install https://dl.fedoraproject.org/pub/epel/epel-release-latest-7.noarch.rpm
Or like this (CentOS 8).
dnf install https://dl.fedoraproject.org/pub/epel/epel-release-latest-8.noarch.rpm
The yum list command should now return something like this.
epel-release.noarch 7-11 @extras
Now the /etc/yum.repos.d directory should contain EPEL files.
~]$ ll /etc/yum.repos.d/
-rw-r--r--. 1 root root 1664 Apr 7 2020 CentOS-Base.repo
-rw-r--r--. 1 root root 1309 Apr 7 2020 CentOS-CR.repo
-rw-r--r--. 1 root root 649 Apr 7 2020 CentOS-Debuginfo.repo
-rw-r--r--. 1 root root 314 Apr 7 2020 CentOS-fasttrack.repo
-rw-r--r--. 1 root root 630 Apr 7 2020 CentOS-Media.repo
-rw-r--r--. 1 root root 1331 Apr 7 2020 CentOS-Sources.repo
-rw-r--r--. 1 root root 7577 Apr 7 2020 CentOS-Vault.repo
-rw-r--r--. 1 root root 616 Apr 7 2020 CentOS-x86_64-kernel.repo
-rw-r--r-- 1 root root 1050 Oct 31 2020 epel.repo
-rw-r--r-- 1 root root 1149 Oct 31 2020 epel-testing.repo
By default, in the /etc/yum.repos.d/epel.repo file, where only the "epel" block is enabled. A block can be permanently enabled (1) or disabled (0) by editing the epel.repo file.
[epel]
name=Extra Packages for Enterprise Linux 7 - $basearch
#baseurl=http://download.fedoraproject.org/pub/epel/7/$basearch
metalink=https://mirrors.fedoraproject.org/metalink?repo=epel-7&arch=$basearch&infra=$infra&content=$contentdir
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
metalink=https://mirrors.fedoraproject.org/metalink?repo=epel-debug-7&arch=$basearch&infra=$infra&content=$contentdir
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
metalink=https://mirrors.fedoraproject.org/metalink?repo=epel-source-7&arch=$basearch&infra=$infra&content=$contentdir
failovermethod=priority
enabled=0
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-EPEL-7
gpgcheck=1
Or, a block can be temporarily enabled using the yum install --enablerepo command.
dnf install --enablerepo epel-debuginfo
A block can be temporarily disabled using the yum install --disablerepo command.
dnf install --disablerepo epel-debuginfo
Did you find this article helpful?
If so, consider buying me a coffee over at