Enable EPEL (Extra Packages for Enterprise Linux) in Amazon Linux 2 for installing various additional software packages that run on RPM-based Linux.
Apart from the official repository of Amazon Linux 2, we can add a popular one known as EPEL. That stands for Extra Packages for Enterprise Linux, a community-driven project for RedHat Linux. However, it is not limited to REHL; we can add it to other Linux systems based on it, such as CentOS, AlmaLinux, Rocky Linux, Oracle Linux, and more. So, AWS AMI Linux is also a Fedora drive project and uses RPM packages; hence EPEL is also available for it as well.
The group of volunteers maintains this repository and its packages. It includes a wide range of software, including libraries, utilities, and applications that cannot be installed using the official repo of the distribution.
With each new version of Redhat, EPEL also releases a dedicated repo containing well-test packages that are compatible with the RHEL version.
EPEL packages can be installed and managed using the standard YUM or DNF package management tools. However, unlike other popular Linux, the way to enable EPEL on Amazon Linux is slightly different, and in this article, we know that.
Installing EPEL on Amazon Linux 2
Start with updating
Let’s first issue a command that is not necessary; however, it is good to make sure our system is up to date, right? Use YUM and run the update command.
sudo yum update -y
We cannot enable the EPEL on Amazon Linux 2 using the YUM package manager by default unless a user is not manually adding the EPEL repository. However, we don’t need to do this.
By default, the Amazon Linux 2 comes with a tool or repo called Amazon-Linux Extra that includes all the major Repos or packages we are required to install on our Linux system. This also includes EPEL.
Nevertheless, if you don’t have it, then use this command.
sudo yum install amazon-linux-extras
Enable EPEL Repository
Now, let’s use the signal-given command that will install the EPEL on your Amazon Linux 2.
sudo amazon-linux-extras install epel -y
List All repos
Once the installation is completed, the Extra packages for Enterprise Linux will be on your system. Let’s check whether it has been successfully enabled on the system or not. For that, list all available repositories by using the given command:
yum repolist all
You can see that EPEL/x86_64 is enabled, and we can install available packages through it.
Disable EPEL on Amazon Linux 2 (optional)
In the future, you may want to disable the EPEL repository again on Amazon EC2 Linux; if that is the case, then here is the command you can go with.
sudo yum-config-manager --disable epel