Introduction to RHEL Repositories
YUM is a command-line package management software for RPM-based Linux systems that is licensed under the GNU General Public License. Yum is a Red Hat package manager that can search for and download available packages from repositories, install and delete them, and update an entire system to the most recent version. When updating, installing, or removing packages, Yum uses automatic dependency resolution to determine, fetch, and install all available dependant packages.
Understanding REMI Repositories
A Remi Collect, established and maintains REMI, which is a free to use repository. The main purpose of the REMI repository is to give the most up-to-date versions of the PHP stack, as well as certain other software packages, to Fedora and Enterprise Linux (Rocky Linux, AlmaLinux, RHEL, CentOS, Oracle, Scientific Linux) OS.
REMI-safe Repository
This repository is for individuals who wish to prioritize distribution and EPEL packages without having to replace them (for example, to maintain Red Hat support), but who require some additional extensions that aren’t yet accessible in EPEL. This repository is both non-intrusive and extremely safe, as it does not replace or clash with any distribution or EPEL packages. Some libraries required by these additions are also available in the repository. The packages are identical to those in “remi,” indicating that this is a subset of the main repository.
The majority of REMI’s packages aren’t found in the default operating system repository. If they exist, they are most likely obsolete and lack newer features. On the Rocky Linux 9 | AlmaLinux 9 Linux distribution, this instruction will show you how to enable REMI Repository.
Enable REMI Repository on Rocky Linux 9 | AlmaLinux 9
Enable REMI Repository on Rocky Linux 9 | AlmaLinux 9 is as simple as following the steps below.
Pre-requisites For REMI Repository Installation
Before you can enable REMI Repository, make sure you have the following:
- Rocky Linux 9 | AlmaLinux 9 Server or Desktop
- Internet on your Rocky / AlmaLinux systems
- Superuser privileges (sudo)
Step 1: Enable EPEL Repo on Rocky Linux 9 | AlmaLinux 9
Before installing the REMI repository, we must first activate the popular Extra Packages for Enterprise Linux (EPEL) repository on our Rocky Linux 8 or AlmaLinux 8 server.
To do so, use the following command:
sudo dnf install epel-release
Accept the installation prompt by pressing y or Y on your keyboard:
Last metadata expiration check: 0:07:01 ago on Thu 06 Feb 2025 09:13:17 PM EAT.
Dependencies resolved.
=====================================================================================================================================================
Package Architecture Version Repository Size
=====================================================================================================================================================
Installing:
epel-release noarch 9-7.el9 extras 19 k
Transaction Summary
=====================================================================================================================================================
Install 1 Package
Total download size: 19 k
Installed size: 26 k
Is this ok [y/N]: y
After activating EPEL Repo, run System Update:
sudo dnf update -y
Step 2: Enable REMI Repository on Rocky Linux 9 | AlmaLinux 9
To install the REMI repository on Rocky Linux 9 | AlmaLinux 9, type the following commands in your terminal:
sudo dnf install http://rpms.remirepo.net/enterprise/remi-release-9.rpm
Accept the installation prompt to proceed:
Last metadata expiration check: 0:00:06 ago on Thu 06 Feb 2025 09:21:15 PM EAT.
remi-release-9.rpm 53 kB/s | 32 kB 00:00
Dependencies resolved.
=====================================================================================================================================================
Package Architecture Version Repository Size
=====================================================================================================================================================
Installing:
remi-release noarch 9.5-2.el9.remi @commandline 32 k
Transaction Summary
=====================================================================================================================================================
Install 1 Package
Total size: 32 k
Installed size: 34 k
Is this ok [y/N]: y
Now, check enabled repositories:
$ sudo yum repolist
repo id repo name
appstream Rocky Linux 9 - AppStream
baseos Rocky Linux 9 - BaseOS
epel Extra Packages for Enterprise Linux 9 - x86_64
epel-cisco-openh264 Extra Packages for Enterprise Linux 9 openh264 (From Cisco) - x86_64
extras Rocky Linux 9 - Extras
remi-modular Remi's Modular repository for Enterprise Linux 9 - x86_64
remi-safe Safe Remi's RPM repository for Enterprise Linux 9 - x86_64
Using REMI Repository on Rocky Linux 9 | AlmaLinux 9
REMI Repository is used in the following ways in Rocky Linux 9 | AlmaLinux 9:
1. List available packages in REMI Repository
To list available packages in REMI repository, we use the following command:
sudo dnf --disablerepo="*" --enablerepo="remi" list available
You can also use the following command to list available packages in REMI-safe repo:
sudo dnf --disablerepo="*" --enablerepo="remi-safe" list available
2. Installing Packages from Remi / Remi-safe repos
Example: Installing PHP Modules
You must enable packages from the REMI repository in order to utilize them. Let’s look at a list of modules that provide php using the following command.
$ sudo dnf module list php
Remi's Modular repository for Enterprise Linux 9 - x86_64 403 kB/s | 776 kB 00:01
Last metadata expiration check: 0:00:01 ago on Thu 06 Feb 2025 09:26:00 PM EAT.
Rocky Linux 9 - AppStream
Name Stream Profiles Summary
php 8.1 common [d], devel, minimal PHP scripting language
php 8.2 common [d], devel, minimal PHP scripting language
Remi's Modular repository for Enterprise Linux 9 - x86_64
Name Stream Profiles Summary
php remi-7.4 common [d], devel, minimal PHP scripting language
php remi-8.0 common [d], devel, minimal PHP scripting language
php remi-8.1 common [d], devel, minimal PHP scripting language
php remi-8.2 common [d], devel, minimal PHP scripting language
php remi-8.3 common [d], devel, minimal PHP scripting language
php remi-8.4 common [d], devel, minimal PHP scripting language
Hint: [d]efault, [e]nabled, [x]disabled, [i]nstalled
In the above output, we have seen the php modules provided by REMI repository. Now, we can install the as follows.
Here we choose to install PHP 8.4 for our demonstration:
$ sudo dnf module install php:remi-8.4
Last metadata expiration check: 0:02:11 ago on Thu 06 Feb 2025 09:26:00 PM EAT.
Dependencies resolved.
=====================================================================================================================================================
Package Architecture Version Repository Size
=====================================================================================================================================================
Installing group/module packages:
php-cli x86_64 8.4.3-1.el9.remi remi-modular 3.9 M
php-common x86_64 8.4.3-1.el9.remi remi-modular 750 k
php-fpm x86_64 8.4.3-1.el9.remi remi-modular 2.0 M
php-mbstring x86_64 8.4.3-1.el9.remi remi-modular 536 k
php-xml x86_64 8.4.3-1.el9.remi remi-modular 916 k
Installing dependencies:
httpd-filesystem noarch 2.4.62-1.el9_5.2 appstream 12 k
libxslt x86_64 1.1.34-9.el9 appstream 240 k
oniguruma5php x86_64 6.9.10-1.el9.remi remi-safe 222 k
Installing weak dependencies:
nginx-filesystem noarch 2:1.20.1-20.el9.0.1 appstream 8.4 k
Installing module profiles:
php/common
Enabling module streams:
php remi-8.4
Transaction Summary
=====================================================================================================================================================
Install 9 Packages
Total download size: 8.5 M
Installed size: 40 M
Is this ok [y/N]: y
Confirm php version installed:
$ php -v
PHP 8.4.3 (cli) (built: Jan 15 2025 01:03:17) (NTS gcc x86_64)
Copyright (c) The PHP Group
Built by Remi's RPM repository <https://rpms.remirepo.net/> #StandWithUkraine
Zend Engine v4.4.3, Copyright (c) Zend Technologies
Disable or Enable REMI Repository
Install yum-config-manager, which allows you to rapidly enable and disable a repository from the command line.
sudo dnf -y install dnf-utils
Enable or Disable repositories Temporarily
To prevent a package from being updated, we can temporarily exclude a repository.
$ sudo dnf --disablerepo=remi-safe update
....
Transaction Summary
===============================================================================================================================================================================================
Upgrade 7 Packages
Total download size: 116 M
Is this ok [y/N]: y
Enable or Disable repositories Permanently
To enable REMI repository permanently, edit /etc/yum.repos.d/remi.repo file. Find the line enabled =0 and change it to 1 as shown below:
$ sudo vim /etc/yum.repos.d/remi.repo
[remi]
name=Remi's RPM repository for Enterprise Linux $releasever - $basearch
#baseurl=http://rpms.remirepo.net/enterprise/$releasever/remi/$basearch/
#mirrorlist=https://rpms.remirepo.net/enterprise/$releasever/remi/$basearch/httpsmirror
mirrorlist=http://cdn.remirepo.net/enterprise/$releasever/remi/$basearch/mirror
enabled=1
gpgcheck=1
# can be enabled if not behind a proxy because of possible cache issue
repo_gpgcheck=0
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-remi.el$releasever
The file should be saved and closed. To make the changes take effect, update the repository listings:
sudo dnf update -y
sudo dnf repolist
Conclusion
Cheers! Our tutorial on how to Enable REMI Repository on Rocky Linux 9 | AlmaLinux 9 is now complete. I hope you found the information to be of assistance. Keep an eye out for more educational resources.
More Guide: