Configuring amazon-linux-extras epel on Amazon Linux 2 in a private subnet - Stack Overflow
Amazon Linux Extras versus EPEL
I've tested installing a few packages from EPEL for Enterprise Linux 7. Make sure you do use the EL7 version, since Amazon Linux 2 is systemd based:
https://dl.fedoraproject.org/pub/epel/epel-release-latest-7.noarch.rpm
amazon-linux-extras only has a few packages for now, so if that's all you need, great. Depending on the packages you install, you always run the risk of conflicts between EPEL and Amazon repos.
More on reddit.comamazon-linux-extras install epel broken on ARM64 instances
enable epel in AWS Linux 2022
I'm taking an initial look at Amazon Linux 2, and see that the EPEL repo is not available by default. I've read the FAQ about Extras, but this seems more akin to Software Collections (SCL) than EPEL.
Has anyone enabled EPEL for Linux 2, and if so, are you using the standard Redhat 7 EPEL, or a different repo?
Thanks.
The EPEL repo is not supported on Amazon Linux 2023.
From the docs
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.
Source: https://docs.aws.amazon.com/linux/al2023/ug/compare-with-al2.html#epel
It's easy enough to spin up another instance so I'm just going to spin up an Amazon Linux 2 AMI and do the work on there instead.
Even though the EPEL repository is not available for Amazon Linux 2023, you can still use Fedora repositories as alternatives because AL2023 and Fedora share a close relationship, and EPEL is a part of the Fedora Project.
Below is an example of a configuration file for the Fedora 36 repository:
# /etc/yum.repos.d/fedora.repo
[fedora]
name=Fedora 36 - $basearch
#baseurl=http://download.example/pub/fedora/linux/releases/36/Everything/$basearch/os/
metalink=https://mirrors.fedoraproject.org/metalink?repo=fedora-36&arch=$basearch
enabled=1
metadata_expire=7d
repo_gpgcheck=0
type=rpm
gpgcheck=1
gpgkey=https://getfedora.org/static/fedora.gpg
https://src.fedoraproject.org/rpms/fedora-repos/raw/f36/f/RPM-GPG-KEY-fedora-36-primary
skip_if_unavailable=False
Upon successful configuration, you can access Fedora 36 packages.
bash-5.2$ dnf repoquery --nvr gimp
Last metadata expiration check: 0:26:43 ago on Thu Jun 6 10:04:18 2024.
gimp-2.10.30-1.fc36.1
Refs.
- Add Fedora repositories to AL2023 (Japanese)
- Add RPM Fusion repositories to AL2023 (Japanese)
You should check that epel is enabled using
yum repolist enabled
If it's not then you can edit /etc/yum.repos.d/epel.repo and change the [epel] section
enabled=0
to
enabled=1
or use
yum-config-manager --enable epel
Update for Amazon Linux 2:
sudo yum install https://dl.fedoraproject.org/pub/epel/epel-release-latest-7.noarch.rpm
Or,
sudo amazon-linux-extras install epel -y
Or,
sudo amazon-linux-extras enable epel
sudo yum install -y epel-release