15%

Save 15% on All Hosting Services

Test your skills and get Discount on any hosting plan

Use code:

Skills
Get Started
30.10.2024
1 +1

How to Enable the EPEL Repository on CentOS, RHEL, and Fedora

The Extra Packages for Enterprise Linux (EPEL) repository is an invaluable, community-maintained collection of high-quality, open-source packages that extends the default software available on enterprise Linux distributions such as CentOS, RHEL (Red Hat Enterprise Linux), and Fedora. Maintained by the Fedora Project, EPEL fills critical gaps left by the default repositories — providing utilities, development libraries, monitoring tools, and much more that system administrators and developers rely on daily.

Whether you are managing a production server, a development environment, or a VPS Hosting instance, enabling the EPEL repository is one of the first configuration steps you should perform after a fresh Linux installation. This comprehensive guide walks you through every step of the process, from verifying your system version to installing and updating packages from EPEL.

What Is the EPEL Repository and Why Do You Need It?

The default repositories bundled with CentOS and RHEL are intentionally conservative — they prioritize stability and long-term support over breadth of software. While this is ideal for enterprise production environments, it means that many popular tools and packages are simply not available out of the box.

EPEL solves this problem by providing:

  • Thousands of additional packages not found in the default RHEL/CentOS repositories
  • Regularly maintained and updated software built to enterprise-grade quality standards
  • Full compatibility with RHEL-based distributions without conflicting with core system packages
  • Free access to tools commonly used in DevOps, security, monitoring, and web development

Popular packages available exclusively through EPEL include htop, iftop, fail2ban, nginx (on older releases), python-pip, certbot, and many more.

Prerequisites

Before proceeding, ensure you have:

  • A system running CentOS 7/8, RHEL 7/8/9, or Fedora
  • Root or sudo privileges on the machine
  • An active internet connection
  • Basic familiarity with the Linux command line

Step 1: Check Your Linux Distribution and Version

Before enabling EPEL, you must confirm which distribution and version you are running. The EPEL package differs between major OS versions, so installing the wrong one can cause errors.

Run the following command:

cat /etc/*release

Example output on CentOS 8:

NAME="CentOS Linux"
VERSION="8"
ID="centos"
VERSION_ID="8"

Alternative commands you can also use:

# Display OS version in a concise format
hostnamectl

# Show kernel and architecture details
uname -r

Make a note of your VERSION_ID — you will need it to select the correct installation command in the next step.

Step 2: Install the EPEL Release Package

The EPEL repository is distributed through a package called epel-release, which automatically configures the correct repository files and GPG keys on your system.

For CentOS / RHEL 7

CentOS 7 uses yum as its default package manager:

sudo yum install epel-release -y

For CentOS / RHEL 8

CentOS 8 and RHEL 8 use dnf, the modern successor to yum:

sudo dnf install epel-release -y

> Note for RHEL 8 users: You may also need to enable the CodeReady Linux Builder (CRB) repository, as some EPEL packages depend on it:

>

> “`bash

> sudo subscription-manager repos –enable codeready-builder-for-rhel-8-$(arch)-rpms

> “`

For RHEL 9

sudo dnf install https://dl.fedoraproject.org/pub/epel/epel-release-latest-9.noarch.rpm -y
sudo dnf config-manager --set-enabled crb

For Fedora

Fedora already includes the EPEL repository configuration in many setups, but if it is not active, install it with:

sudo dnf install epel-release -y

Step 3: Verify That the EPEL Repository Is Enabled

After installing the epel-release package, the EPEL repository is typically enabled automatically. You should verify this before attempting to install any packages.

For systems using yum (CentOS/RHEL 7):

yum repolist

For systems using dnf (CentOS/RHEL 8+, Fedora):

dnf repolist

Expected output (look for the EPEL entry):

repo id                      repo name                                    status
epel                         Extra Packages for Enterprise Linux 8 - x86_64  enabled

Manually Enabling EPEL If It Appears Disabled

If the EPEL repository shows as disabled in the list, you can enable it manually.

Using yum-config-manager (RHEL/CentOS 7):

sudo yum-config-manager --enable epel

Using dnf config-manager (RHEL/CentOS 8+):

sudo dnf config-manager --set-enabled epel

You can also directly edit the repository configuration file:

sudo nano /etc/yum.repos.d/epel.repo

Find the enabled=0 line and change it to enabled=1, then save the file.

Step 4: Install Packages from the EPEL Repository

With EPEL enabled, you now have access to thousands of additional packages. Installing them works exactly the same as installing any standard package.

Using yum (CentOS/RHEL 7):

sudo yum install package_name -y

Using dnf (CentOS/RHEL 8+, Fedora):

sudo dnf install package_name -y

Replace package_name with the actual name of the software you want to install.

Practical Examples

Install htop (an interactive process viewer):

sudo dnf install htop -y

Install fail2ban (a log-based intrusion prevention tool):

sudo dnf install fail2ban -y

Install certbot (for free SSL/TLS certificates):

sudo dnf install certbot -y

> Pro tip: You can search for available EPEL packages before installing them:

>

> “`bash

> dnf search keyword

> dnf info package_name

> “`

Step 5: Keep Your System and EPEL Packages Up to Date

Maintaining an up-to-date system is critical for security and stability — especially on servers exposed to the internet. Regularly update all installed packages, including those from EPEL.

Using yum (CentOS/RHEL 7):

sudo yum update -y

Using dnf (CentOS/RHEL 8+, Fedora):

sudo dnf update -y

This single command updates packages from all enabled repositories, including both the default OS repositories and EPEL simultaneously.

For production servers, consider automating security updates using dnf-automatic:

sudo dnf install dnf-automatic -y
sudo systemctl enable --now dnf-automatic.timer

Troubleshooting Common EPEL Issues

Error: "Cannot find a valid baseurl for repo: epel"

This typically indicates a DNS or network connectivity issue. Verify your server has internet access:

ping -c 4 google.com
curl -I https://dl.fedoraproject.org

GPG Key Errors

If you encounter GPG key verification errors, import the EPEL GPG key manually:

sudo rpm --import https://dl.fedoraproject.org/pub/epel/RPM-GPG-KEY-EPEL-8

Package Conflicts

If an EPEL package conflicts with a default repository package, use the --allowerasing flag:

sudo dnf install package_name --allowerasing

Disabling or Removing the EPEL Repository

If you ever need to disable EPEL temporarily (for example, to troubleshoot a package conflict), run:

sudo dnf config-manager --set-disabled epel

To completely remove the EPEL repository from your system:

sudo dnf remove epel-release -y

Choosing the Right Hosting Environment for Your Linux Server

Enabling EPEL is just one of many configuration steps that go into building a well-optimized Linux server. The quality of your underlying infrastructure matters just as much as your software configuration. AlexHost offers a range of hosting solutions designed to give you full control over your environment:

  • VPS Hosting — Full root access, SSD storage, and scalable resources — ideal for running custom Linux configurations with EPEL and beyond.
  • Dedicated Servers — Maximum performance and isolation for demanding workloads that require complete hardware control.
  • VPS Control Panels — Simplify server management with intuitive control panel options, perfect for administrators who want power without complexity.
  • SSL Certificates — Secure your web applications and services with trusted SSL/TLS certificates, complementing tools like certbot you install via EPEL.
  • Shared Web Hosting — A cost-effective entry point for smaller projects that don't require full server customization.

Conclusion

Enabling the EPEL repository on CentOS, RHEL, or Fedora is a straightforward but highly impactful step that dramatically expands the software ecosystem available to you. By following the steps outlined in this guide — checking your system version, installing the epel-release package, verifying the repository status, and keeping packages updated — you gain access to thousands of high-quality packages that the default repositories simply do not provide.

Whether you are a system administrator setting up a new server, a developer building applications, or a DevOps engineer managing infrastructure, EPEL is an essential tool in your Linux toolkit. Pair it with a reliable hosting environment from AlexHost, and you have a solid foundation for any project.

*Have questions about configuring your Linux server or choosing the right hosting plan? Explore AlexHost's VPS Hosting options or contact our support team for expert guidance.*

15%

Save 15% on All Hosting Services

Test your skills and get Discount on any hosting plan

Use code:

Skills
Get Started