Enabling the REMI Repository on Rocky Linux 8
What you’ll get:
If you’re stuck at a missing PHP or MariaDB version, the REMI repo is your rescue hatch. I’ve used it after an OS upgrade that stripped out newer packages, so let’s walk through adding it fast and safely.
Why You Need REMI
Rocky 8 ships with solid defaults, but when you want PHP 7.4 or MariaDB 10.5 you’ll hit a dead end. The REMI repository supplies those newer builds while keeping your base system intact. I’ve seen this happen after an update to the latest Rocky release: the default repos roll back to older, more stable packages, leaving developers out of luck.
Install EPEL – the prerequisite
sudo dnf install -y epel-release
EPEL houses many extra RPMs your system might need. Without it, REMI’s GPG key can’t be imported properly.
Add DNF plugins for repo management
sudo dnf install -y dnf-plugins-core
dnf config-manager (the tool we’ll use next) lives here. It lets you toggle repos without editing files manually.
Import REMI’s GPG key
sudo rpm --import https://rpms.remirepo.net/RPM-GPG-KEY-remi
The key guarantees the packages haven’t been tampered with. Skipping this step is a risk you don’t need to take.
Enable the REMI repo for your desired stack
sudo dnf config-manager --set-enabled remi-php74 # For PHP 7.4
If you only want MariaDB, use remi-mariadb105. The naming convention matches the major version.
Tip: If you’re not sure which REMI variant to enable, run dnf repolist all | grep remi – it lists every available REMI repo so you can pick the right one.
(Optional) Give REMI a lower priority
Rocky’s base repos should win by default. If you want to keep that order but still prefer REMI for specific packages, add a simple preference file:
sudo bash -c 'echo -e "[remi]\nname=RHEL 8 - REMI\npriority=99" > /etc/yum.repos.d/remi.pref'
That way, if you accidentally install a package from REMI that conflicts with the base repo, your system will fall back to the stable version.
Install your package
sudo dnf install php74-cli # Replace with whatever you need
Now your installation pulls from REMI and you’re good to go. I’ve had this work for PHP‑based projects that require newer extensions without messing up the core OS.
Quick sanity check
Verify what’s being used:
dnf repoquery --repos remi-php74 --list php74-cli
You should see the REMI URL in the output. If not, double‑check the repo name or that the key imported correctly.
Final thought
Adding REMI isn’t a silver bullet, but it’s the easiest way to get newer packages on Rocky 8 without resorting to building from source. Keep the base repos enabled and let REMI handle the extras.