Install & Enable EPEL and EPEL‑Next on Rocky Linux 9 – Quick Guide
If you’re working on a Rocky 9 box that needs packages not shipped with the base repo, you’ll probably want to tap into EPEL. And when you need bleeding‑edge stuff (think newer GNOME or updated drivers), there’s also the optional EPEL‑Next repository.
What You’ll Learn
- How to make sure you have the tooling needed to play with repos.
- The simplest way to add the official EPEL repo.
- When and how to enable the experimental EPEL‑Next repo.
- A quick sanity check that everything is wired up correctly.
Step 1: Make Sure You Have dnf‑plugins-core
config-manager lives in this package, and you’ll need it to toggle repos on or off.
sudo dnf install -y dnf-plugins-core
If you skip this, the next command will just spit out a “command not found” error.
Step 2: Grab the Official EPEL Package
Rocky 9 is essentially RHEL 9, so the Fedora‑maintained EPEL package works perfectly.
sudo dnf install -y epel-release
Why this matters: The epel-release RPM installs two .repo files under /etc/yum.repos.d/. Those files tell DNF where to find packages that live outside the base set. Without them, you’re stuck with whatever’s in Rocky’s official repos.
After installing, refresh the metadata so DNF knows about all the new packages:
sudo dnf makecache
Step 3: Verify EPEL Is Active
A quick sanity check keeps the whole thing from feeling like a magic trick.
dnf repolist all | grep epel
You should see something like:
epel Extra Packages for Enterprise Linux 9 - $basearch Enabled
If it shows Enabled, you’re good to go. If not, double‑check the .repo file or try reinstalling epel-release.
Step 4: (Optional) Enable EPEL‑Next
EPEL‑Next contains packages that are newer than their stable counterparts but aren’t fully vetted for RHEL 9 compatibility yet. Use it when you need a feature that’s not in the main repo, or if you’re testing something on a staging system.
sudo dnf config-manager --set-enabled epel-next
Why bother? Because without this flag, the epel-next repo is left dormant and nothing from it will install. And remember: “newer” doesn’t always mean “safer.” I once pulled in an experimental kernel version from EPEL‑Next and my machine failed to boot until I rolled back.
Step 5: Double‑Check Everything
Run the list again, but this time look for both repos:
dnf repolist all | grep epel
You should now see two lines, one for epel and another for epel-next, with Enabled status.
If you ever need to turn EPEL‑Next off (good practice after a test run), just flip the flag back:
sudo dnf config-manager --set-disabled epel-next
Step 6: Install Your Packages
You’re ready for any package that lives in those repos. For example, installing htop from EPEL is as simple as:
sudo dnf install -y htop
If you wanted the newer, experimental build from EPEL‑Next (when it exists), you’d specify its name if it differs or just let DNF pick the highest version.
Quick Recap
1. Install dnf-plugins-core to get config-manager.
2. Install epel-release for the official repo.
3. Verify EPEL is enabled.
4. Enable epel-next if you need bleeding‑edge packages.
5. Double‑check both repos are active.
6. Start installing.
That’s all the heavy lifting. Happy hacking, and remember: if a package from EPEL‑Next starts giving you grief, just disable it and you’re back to the safe zone.