Skip to content

How do I activate the EPEL repository for my Amazon EC2 instance that runs CentOS, RHEL, or Amazon Linux?

2 minute read
1

I want to get access to the Extra Packages for Enterprise Linux (EPEL) repository in my Amazon Elastic Compute Cloud (Amazon EC2) instance. The instance runs CentOS, Red Hat Enterprise Linux (RHEL), Amazon Linux 2 (AL2), or Amazon Linux 2023 (AL2023).

Resolution

Important: The third-party EPEL7 repository reached end of life, so no longer receives updates or security fixes.

To use the EPEL repository on your EC2 instance, take the following actions based on your distribution.

To determine the distribution that you use, run the following command:

cat /etc/os-release

Install EPEL on Amazon Linux instances

Important: AL2 will reach end of life on June 30, 2026. Make sure to migrate your AL2 instances to AL2023 before that date. AL2023 uses Supplementary Packages for Amazon Linux (SPAL) instead of EPEL.

For AL2023, run the following command to install SPAL:

sudo dnf install spal-release -y

For AL2, run the following command to install the EPEL release package:

sudo amazon-linux-extras install epel -y

Install EPEL on RHEL instances

Run one of the following commands based on your RHEL version.

RHEL 10:

sudo dnf install https://dl.fedoraproject.org/pub/epel/epel-release-latest-10.noarch.rpm -y

RHEL 9:

sudo dnf install https://dl.fedoraproject.org/pub/epel/epel-release-latest-9.noarch.rpm -y

RHEL 8:

sudo dnf install https://dl.fedoraproject.org/pub/epel/epel-release-latest-8.noarch.rpm -y

RHEL 7:

sudo yum -y install https://dl.fedoraproject.org/pub/epel/epel-release-latest-7.noarch.rpm

Install EPEL on CentOS instances

Run one of the following commands based on your CentOS version.

CentOS Stream 10:

sudo dnf install https://dl.fedoraproject.org/pub/epel/epel-release-latest-10.noarch.rpm -y

CentOS Stream 9:

sudo dnf install https://dl.fedoraproject.org/pub/epel/epel-release-latest-9.noarch.rpm -y

CentOS Stream 8:

sudo sed -i 's/mirrorlist/#mirrorlist/g' /etc/yum.repos.d/CentOS-*
sudo sed -i 's|#baseurl=http://mirror.centos.org|baseurl=http://vault.centos.org|g' /etc/yum.repos.d/CentOS-*
sudo dnf install https://dl.fedoraproject.org/pub/epel/epel-release-latest-8.noarch.rpm -y

CentOS 7:

sudo yum -y install epel-release

Note: CentOS 7 includes the epel-release package in the base repositories.

Verify that you activated the EPEL repository

Run the following command:

sudo yum repolist

Related information

Add repositories on an AL2 instance

AL2 Extras Library

Amazon Linux 2 FAQs

AWS OFFICIALUpdated 5 months ago
11 Comments

What about Amazon Linux 2023?

replied 4 years ago

Thank you for your comment. We'll review and update the Knowledge Center article as needed.

AWS
EXPERT

replied 4 years ago

from https://docs.aws.amazon.com/linux/al2023/ug/compare-with-al2.html#epel

how long does it take for an article to be updated?Extra Packages for Enterprise Linux (EPEL)

Extra Packages for Enterprise Linux (EPEL) is a project in the Fedora community with the objective of creating a large array of packages for enterprise-level Linux operating systems. The project has primarily produced RHEL and CentOS packages. Amazon Linux 2 features a high level of compatibility with CentOS 7. As a result, many EPEL7 packages work on Amazon Linux 2. However, AL2023 doesn't support EPEL or EPEL-like repositories.

replied 4 years ago

It's a good question: why can't we use EPEL or amazon-linux-extras on Amazon Linux 2023? I raised an AL2023 server and it reached a point that it ended up useless. I'm considering trying an older AL version (which is ridiculous) or a different Linux distro (which I would not like to do due to the company's standards)..

replied 3 years ago

Thank you for your comment. We'll review and update the Knowledge Center article as needed.

AWS
MODERATOR

replied 3 years ago

@AWS Official - When will the Knowledge Center article be reviewed to include EPEL? You must have a timeline.

replied 3 years ago

Any idea how to get this working on AL2023?

replied 2 years ago

Thank you for your comment. We'll review and update the Knowledge Center article as needed.

AWS
MODERATOR

replied 2 years ago

sudo yum -y install https://dl.fedoraproject.org/pub/epel/epel-release-latest-7.noarch.rpm no longer works as the file epel-release-latest-7.noarch.rpm is not present in https://dl.fedoraproject.org/pub/epel/

replied 2 years ago

This article was reviewed and updated on 2026-06-16.

AWS
EXPERT

replied 5 months ago