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

2 minute read
0

I want to turn on access to the Extra Packages for Enterprise Linux (EPEL) repository in an Amazon Elastic Compute Cloud (Amazon EC2) instance. The instance is running CentOS, Red Hat Enterprise Linux (RHEL), or an Amazon Linux-based distribution.

Resolution

To download, install, and turn on the EPEL repository on CentOS, RHEL, or an Amazon Linux-based distribution, run one of the following commands based on your distribution.

To determine the distribution that you're using, run the following command:

cat /etc/os-release

Amazon Linux

Amazon Linux 2023

Amazon Linux 2023 (AL2023) doesn't support EPEL. For more information, see Extra Packages for Enterprise Linux (EPEL).

Amazon Linux 2

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

sudo amazon-linux-extras install epel -y

RHEL

RHEL 8

To install the EPEL release package for RHEL 8, run the following command:

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

RHEL 7

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

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

CentOS

CentOS 8

To install the EPEL release package for RHEL 8, run the following commands:

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  
sudo dnf config-manager --set-enabled PowerTools

Note: The preceding commands turn on both the EPEL and PowerTools repositories.

CentOS 7

To install the EPEL release package, run the following command:

sudo yum -y install epel-release

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

Verify that the EPEL repository is turned on

To verify that the EPEL repository is turned on, run the following repolist command:

sudo yum repolist

Related information

How can I use these extra packages? on the Fedora website

Add repositories on an AL2 instance

AL2 Extras Library

Amazon Linux 2 FAQs

AWS OFFICIAL
AWS OFFICIALUpdated 4 months ago
9 Comments

What about Amazon Linux 2023?

replied 2 years ago

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

profile pictureAWS
MODERATOR
replied 2 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 a year 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)..

Luis T
replied a year ago

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

profile pictureAWS
MODERATOR
replied a year ago

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

replied a year ago

Any idea how to get this working on AL2023?

profile picture
Mark
replied 5 months ago

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

profile pictureAWS
MODERATOR
replied 5 months 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/

AK
replied a month ago