How to install and enable REMI repository on CentOS 9 Stream

How to install and enable REMI repository ion CentOS 9 Stream / RHEL 9

Remi repository is one of third-party repository that have latest update of PHP on Enterprise Linux such as Red Hat, CentOS, Fedora.

You can read more about Remi’s RPM repository site on https://rpms.remirepo.net

To install Remi repository on Centos, first you need to enable EPEL Repository On CentOS 9 Stream / RHEL 9

Also Read: How install Remi repository on Centos / RHEL 7/6

Enable the CodeReady Linux Builder repository. We already have access to it; you just need to enable it.

On CentOS 9 Stream:

sudo dnf config-manager --set-enabled crb

On RHEL 9:

sudo subscription-manager repos --enable codeready-builder-for-rhel-9-$(arch)-rpms

Then enable Epel on CentOS 9 Stream

sudo dnf install epel-release epel-next-release

On RHEL 9:

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

Install and enable Remi Repository

sudo dnf install dnf-utils http://rpms.remirepo.net/enterprise/remi-release-9.rpm

Then we need to refresh DNF and imports GPG keys

sudo dnf update --refresh

Installing PHP 8.2 on CentOS 9 Stream

Official CentOS 9 Stream repositories, PHP 8 is included, so we must disable it

sudo dnf module reset php

To list the all modules available in the system:

sudo dnf module list php

Example Output

# sudo dnf module list php
Last metadata expiration check: 0:09:25 ago on Thu 08 Jun 2023 01:21:06 PM CDT.
CentOS Stream 9 - AppStream
Name                                    Stream                                          Profiles                                                      Summary
php                                     8.1                                             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

Hint: [d]efault, [e]nabled, [x]disabled, [i]nstalled

Enable PHP 8.2 Remi Module and Install PHP 8.2 on CentOS 9 Stream

sudo dnf module enable php:remi-8.2

Then we can install php using this command:

sudo dnf install php php-devel php-fpm php-cgi php-gd php-opcache php-apcu php-mbstring php-gd php-imagick php-xml php-json php-mysqlnd php-pdo

That’s it. Now we can install needed package from Remi Repository.

ServerDiary

ServerDiary

One thought on “How to install and enable REMI repository on CentOS 9 Stream

Leave a Reply

Your email address will not be published. Required fields are marked *