How to Install EPEL on Rocky Linux 9/8

EPEL (Extra Packages for Enterprise Linux) is a repository of high-quality add-on packages for Linux distributions like Rocky Linux maintained by the Fedora Project. It provides a wide array of additional software packages not included in the standard Rocky Linux repositories, enhancing your system’s functionality and usability.

The following guide will demonstrate how to install EPEL and EPEL-Next on Rocky Linux 9 or 8 using command-line commands. This installation method ensures you can access and install a broader range of software packages through the EPEL and EPEL-Next repositories.

Refresh and Update Your Rocky Linux System

Before starting the installation process, updating your Rocky Linux system with the latest packages is imperative. This step ensures compatibility and optimizes the system for the new additions. Execute the following command to achieve this:

sudo dnf upgrade --refresh

This command will refresh the package repository information and upgrade all the packages on your system to their latest versions.

Import EPEL and EPEL Next Repositories

Integrating the EPEL repository is essential to enhance your Rocky Linux system’s capabilities. Given the diverse versions of Rocky Linux, aligning the EPEL repository version with your specific Rocky Linux version is crucial. For optimal performance and compatibility, installing both the standard EPEL and the EPEL Next repositories is advisable.

Option 1: Integrate EPEL for Rocky Linux 9

Enable the CodeReady Builder repository (CRB):

This repository contains additional packages that complement the main distribution and enhance its capabilities. To enable CRB, execute:

sudo dnf config-manager --set-enabled crb

Install EPEL and EPEL Next:

With the CRB enabled, proceed to install the EPEL repositories tailored for Rocky Linux 9 using the following command:

sudo dnf install \
    https://dl.fedoraproject.org/pub/epel/epel-release-latest-9.noarch.rpm \
    https://dl.fedoraproject.org/pub/epel/epel-next-release-latest-9.noarch.rpm

Option 2: Integrate EPEL for Rocky Linux 8

Enable the PowerTools Repository:

Before integrating EPEL, enabling the PowerTools repository is essential, as it provides additional development and debugging tools for Rocky Linux 8. To enable PowerTools, use the following command:

sudo dnf config-manager --set-enabled powertools
Install EPEL and EPEL Next:

With PowerTools enabled, you can now incorporate the EPEL repositories for Rocky Linux 8. Execute the following command:

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

Verification of EPEL or EPEL Next Installation

Upon successfully integrating the EPEL repository into your Rocky Linux system, validating the installation is prudent. This ensures the repository has been correctly configured and ready for use. To achieve this, the dnf repolist command serves as an efficient tool.

Execute the following command:

dnf repolist | grep epel

Expected Output:

epel                    Extra Packages for Enterprise Linux 9 - x86_64
epel-next           Extra Packages for Enterprise Linux 9 - Next - x86_64

If the output matches the above, it confirms the successful integration of the EPEL repository into your system.

Understanding Basic EPEL Command

Being adept with the EPEL or EPEL Next repository commands can significantly enhance your package management experience. Here are some foundational commands to get you started:

Searching for Specific Packages

If you’re unsure about the exact name of a package but have a general idea, you can use the dnf search command:

sudo dnf --enablerepo="epel" search keyword

Replace keyword with a term related to the package you’re looking for. This will return a list of packages that match or are related to the keyword.

Getting Detailed Information

To get detailed information about a specific package, including its description, version, and dependencies:

sudo dnf --enablerepo="epel" info package_name

Checking for Package Updates in EPEL

To see if there are updates available for packages you’ve installed from EPEL:

sudo dnf --enablerepo="epel" check-update

This will list all packages from EPEL that have updates available.

Removing a Package

If you’ve installed a package from EPEL and wish to remove it:

sudo dnf remove package_name

Replace package_name with the name of the package you want to uninstall.

Disabling EPEL Temporarily

There might be times when you want to install or update packages without considering the EPEL repository. To temporarily disable EPEL during a DNF operation:

sudo dnf --disablerepo="epel" command

Replace command with the DNF command you wish to execute.

Keeping EPEL Packages Updated

To ensure that all packages you’ve installed from EPEL are updated:

sudo dnf --enablerepo="epel" upgrade

This will upgrade all EPEL packages to their latest versions.

Conclusion

This guide has shown you how to install EPEL on Rocky Linux 9 or 8, giving you access to a wider range of packages. Keep your system updated for smooth integration. With EPEL installed, you can explore and enhance your Rocky Linux system with additional packages.

Leave a Comment