Skip to content

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

2 minute read
1

I want to turn on 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 (EOL). As a result, this repository no longer receives updates or security fixes. For more information, see Extra Packages for Enterprise Linux (EPEL).

To download, install, and activate the EPEL repository, take the following actions based on your distribution.

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

cat /etc/os-release

Activate EPEL for Amazon Linux

Important: AL2023 doesn't support EPEL.

To install the EPEL release package for RHEL 7 on AL2, run the following command:

sudo amazon-linux-extras install epel -y

Activate EPEL for RHEL

To install the EPEL release package for RHEL, 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

Activate EPEL for CentOS

To install the EPEL release package for CentOS, 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

To 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 7 months ago
10 Comments

What about Amazon Linux 2023?

replied 3 years ago

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

AWS
EXPERT
replied 3 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 3 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 a year ago