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 Amazon Linux-based distribution.

Short description

Standard repositories might not provide all the packages that can be installed on CentOS, RHEL, or Amazon Linux-based distribution. Turning on the EPEL repository provides additional options for package installation.

Resolution

Follow these steps to download, install, and turn on the EPEL repository on CentOS, RHEL, or Amazon Linux-based distribution.

To verify the distribution, 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:

Install the EPEL release package for RHEL 7 and turn on the EPEL repository:

sudo amazon-linux-extras install epel -y

RHEL

RHEL 8:

Install the EPEL release package for RHEL 8.

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

RHEL 7:

Install and turn on the EPEL release package for RHEL 7:

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

CentOS

CentOS 8:

Install the EPEL release package for RHEL 8. Turn on both the EPEL and PowerTools repositories. The PowerTools repository contains development tools that are required by many EPEL packages:

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

CentOS 7:

Install and turn on the EPEL release package. CentOS 7 includes the epel-release package in the base repositories:

sudo yum -y install epel-release

List repositories that are turned on

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

sudo yum repolist

Related information

Add repositories on an Amazon Linux instance

Extras library (Amazon Linux 2)

Amazon Linux 2 FAQs

Extra Packages for Enterprise Linux (EPEL) on the Fedora website

AWS OFFICIAL
AWS OFFICIALUpdated 9 months ago
6 Comments

What about Amazon Linux 2023?

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

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

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

profile pictureAWS
MODERATOR
replied 10 months ago

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

replied 10 months ago