EPEL 仓库
Extra Packages for Enterprise Linux 简称:EPEL 是一个 Fedora 项目,它为企业级Linux Red Hat Enterprise Linux (RHEL)、Rocky Linux (RL)、CentOS、Scientific Linux(SL)、Oracle Enterprise Linux(OEL)、AlmaLinux (AL)等创建、维护和管理一组高质量的附加包。
EPEL 最新版本是 epel-release-latest-9
Remi 仓库
Remi 源大家或许很少听说,但是我们强烈推荐, 尤其对于不想编译最新版的 Linux 使用者, 因为 Remi 源中的软件几乎都是最新稳定版。
或许您会怀疑稳定不?
放心吧, 这些都是 Linux 骨灰级的玩家编译好放进源里的, 他们对于系统环境和软件编译参数的熟悉程度毋庸置疑。
Remi 下载地址:https://rpms.Remirepo.net/
官方认证国内源:https://mirrors.tuna.tsinghua.edu.cn/Remi/
Remi SRPMS 下载地址:https://rpms.Remirepo.net/SRPMS/
Remi 源中包含大量的PHP版本包,可供选择安装,非常方便。
启动 EPEL 与 Remi 仓库
更新系统
dnf update -y
dnf upgrade --refresh -y
在 Rocky Linux 9 上启用 EPEL Repo
在安装 Remi 仓库之前,我们需要在 Rocky Linux 9 中启用并安装 EPEL Repo。
# AlmaLinux 9, Rocky Linux 9
dnf config-manager --set-enabled crb
dnf install epel-release
# CentOS Stream 9
dnf config-manager --set-enabled crb
dnf install epel-release epel-next-release
# RHEL 9
subscription-manager repos --enable codeready-builder-for-rhel-9-$(arch)-rpms
dnf install https://dl.fedoraproject.org/pub/epel/epel-release-latest-9.noarch.rpm
安装完 EPEL 后,更新您的 Rocky Linux 9 系统以使配置生效。
[root@localhost ~]# dnf update
Extra Packages for Enterprise Linux 9 - x86_64 1.1 MB/s | 12 MB 00:10
Last metadata expiration check: 0:00:10 ago on Sat Nov 26 10:22:45 2022.
Dependencies resolved.
Nothing to do.
Complete!
在 Rocky Linux 9 上启用 Remi 仓库。
现在有了 EPEL 仓库,我们需要在 Rocky Linux 9 中启用 Remi 仓库。运行命令:
dnf install https://rpms.Remirepo.net/enterprise/Remi-release-9.rpm
查看仓库源
[root@localhost ~]# dnf repolist
repo id repo name
appstream Rocky Linux 9 - AppStream
baseos Rocky Linux 9 - BaseOS
crb Rocky Linux 9 - CRB
epel Extra Packages for Enterprise Linux 9 - 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
有一个称为 Remi-safe 的仓库。这个 repo 为 PHP 提供额外的包,可以安全地与 RHEL/CentOS/Rocky Base 仓库一起使用。使用 Remi-safe 仓库,所有依赖项都在 Base 或 EPEL 仓库中。
Remi 仓库的使用方法
# 列出 Remi 仓库下所有可供安装的包
dnf --disablerepo="*" --enablerepo="Remi" list available
dnf --disablerepo="*" --enablerepo="Remi-safe" list available
# 这里以安装 php 包为例,使用 Remi 仓库安装包,列出所有 php 包
dnf module list php
# 该命令安装 PHP 8.1 及其所有依赖项
dnf module install php:Remi-8.1
# 通过 Remi 仓库启用或禁用包
# 启用 php Remi-8.1
dnf module enable php:Remi-8.1 -y
# 禁用 php Remi-8.1
dnf module disable php:Remi-8.1 -y
永久启用或禁用 Remi 仓库
vi /etc/yum.repos.d/Remi.repo
# 将 Remi 下面的 enabled 设置为 0 或 1,0:禁用,1:启用。
[Remi]
enabled=0
# 对文件进行更改后,必须更新系统才能使配置生效。
dnf update
dnf repolist