如何在 RHEL 8.7 上升级到 php 8.1?

如何在 RHEL 8.7 上升级到 php 8.1?

如何在 RHEL 8.7 中升级到 php8.1,我浏览了各种指南,最终安装了 php:remi-8.1,这是理想的,但是,由于缺少库,php-gd 不愿意安装。

Problem: package php-gd-7.2.24-1.module+el8.2.0+4601+7c76a223.x86_64 requires php-common(x86-64) = 7.2.24-1.module+el8.2.0+4601+7c76a223, but none of the providers can be installed
  - problem with installed package php-gd-7.2.24-1.module+el8.2.0+4601+7c76a223.x86_64
  - cannot install both php-common-8.1.16-1.el8.remi.x86_64 and php-common-7.2.24-1.module+el8.2.0+4601+7c76a223.x86_64
  - package php-gd-8.1.15-1.el8.remi.x86_64 requires libgd.so.103()(64bit), but none of the providers can be installed
  - package php-gd-8.1.16-1.el8.remi.x86_64 requires libgd.so.103()(64bit), but none of the providers can be installed
  - cannot install the best candidate for the job
  - package php-common-7.2.24-1.module+el8.2.0+4601+7c76a223.x86_64 is filtered out by modular filtering
  - nothing provides libraqm.so.0()(64bit) needed by gd3php-2.3.3-4.el8.remi.x86_64
  - nothing provides libimagequant.so.0()(64bit) needed by gd3php-2.3.3-4.el8.remi.x86_64
  - nothing provides libraqm.so.0()(64bit) needed by gd3php-2.3.3-8.el8.remi.x86_64
  - nothing provides libimagequant.so.0()(64bit) needed by gd3php-2.3.3-8.el8.remi.x86_64
  - nothing provides libavif.so.14()(64bit) needed by gd3php-2.3.3-8.el8.remi.x86_64

有人经历过这种情况吗?迄今为止最好的指南:https://rpms.remirepo.net/wizard/

安装 repos

$ sudo subscription-manager repos --enable codeready-builder-for-rhel-8-x86_64-rpms
Repository 'codeready-builder-for-rhel-8-x86_64-rpms' is enabled for this system.

$ sudo dnf install https://dl.fedoraproject.org/pub/epel/epel-release-latest-8.noarch.rpm
Updating Subscription Management repositories.
Last metadata expiration check: 2:55:33 ago on Tue 14 Mar 2023 08:23:58 GMT.
epel-release-latest-8.noarch.rpm                                   54 kB/s |  24 kB     00:00
Package epel-release-8-18.el8.noarch is already installed.
Dependencies resolved.
Nothing to do.
Complete!

$ sudo dnf install https://rpms.remirepo.net/enterprise/remi-release-8.rpm
Updating Subscription Management repositories.
Last metadata expiration check: 2:55:57 ago on Tue 14 Mar 2023 08:23:58 GMT.
remi-release-8.rpm                                                383 kB/s |  31 kB     00:00
Package remi-release-8.7-2.el8.remi.noarch is already installed.
Dependencies resolved.
Nothing to do.
Complete!

我设法启用了 EPEL 存储库,因此我当前的存储库列表如下:

sudo yum repolist
Updating Subscription Management repositories.
repo id                                                 repo name
codeready-builder-for-rhel-8-x86_64-debug-rpms          Red Hat CodeReady Linux Builder for RHEL 8 x86_64 (Debug RPMs)
codeready-builder-for-rhel-8-x86_64-eus-debug-rpms      Red Hat CodeReady Linux Builder for RHEL 8 x86_64 - Extended Update Support (Debug RPMs)
codeready-builder-for-rhel-8-x86_64-eus-rhui-debug-rpms Red Hat CodeReady Linux Builder for RHEL 8 x86_64 - Extended Update Support from RHUI (Debug RPMs)
codeready-builder-for-rhel-8-x86_64-eus-rhui-rpms       Red Hat CodeReady Linux Builder for RHEL 8 x86_64 - Extended Update Support from RHUI (RPMs)
codeready-builder-for-rhel-8-x86_64-eus-source-rpms     Red Hat CodeReady Linux Builder for RHEL 8 x86_64 - Extended Update Support (Source RPMs)
codeready-builder-for-rhel-8-x86_64-rhui-debug-rpms     Red Hat CodeReady Linux Builder for RHEL 8 x86_64 (Debug RPMs) from RHUI
codeready-builder-for-rhel-8-x86_64-rhui-rpms           Red Hat CodeReady Linux Builder for RHEL 8 x86_64 (RPMs) from RHUI
codeready-builder-for-rhel-8-x86_64-rhui-source-rpms    Red Hat CodeReady Linux Builder for RHEL 8 x86_64 (Source RPMs) from RHUI
codeready-builder-for-rhel-8-x86_64-rpms                Red Hat CodeReady Linux Builder for RHEL 8 x86_64 (RPMs)
codeready-builder-for-rhel-8-x86_64-source-rpms         Red Hat CodeReady Linux Builder for RHEL 8 x86_64 (Source RPMs)
mariadb-main                                            MariaDB Server
mariadb-maxscale                                        MariaDB MaxScale
mariadb-tools                                           MariaDB Tools
remi-modular                                            Remi's Modular repository for Enterprise Linux 8 - x86_64
remi-safe                                               Safe Remi's RPM repository for Enterprise Linux 8 - x86_64
rhel-8-for-x86_64-appstream-rpms                        Red Hat Enterprise Linux 8 for x86_64 - AppStream (RPMs)
rhel-8-for-x86_64-baseos-rpms                           Red Hat Enterprise Linux 8 for x86_64 - BaseOS (RPMs)

但是,现在我遇到了另一个问题。即使在运行

sudo subscription-manager repos --disable codeready-builder-for-rhel-8-x86_64-eus-rhui-source-rpms
sudo dnf clean all && sudo rm -r /var/cache/dnf  && sudo dnf upgrade -y && sudo dnf update -y 

我仍然得到以下内容。

sudo dnf update
Updating Subscription Management repositories.
MariaDB Server                                                    702 kB/s | 673 kB     00:00
MariaDB MaxScale                                                  9.6 kB/s | 8.6 kB     00:00
MariaDB Tools                                                      35 kB/s | 4.4 kB     00:00
Red Hat Enterprise Linux 8 for x86_64 - AppStream (RPMs)           38 MB/s |  52 MB     00:01
Red Hat CodeReady Linux Builder for RHEL 8 x86_64 (Source RPMs) f 600 kB/s | 263 kB     00:00
Red Hat Enterprise Linux 8 for x86_64 - BaseOS (RPMs)              37 MB/s |  57 MB     00:01
Red Hat CodeReady Linux Builder for RHEL 8 x86_64 (Source RPMs)   566 kB/s | 263 kB     00:00
Red Hat CodeReady Linux Builder for RHEL 8 x86_64 (RPMs) from RHU  15 MB/s | 8.8 MB     00:00
Red Hat CodeReady Linux Builder for RHEL 8 x86_64 - Extended Upda 5.5  B/s |  10  B     00:01
Errors during downloading metadata for repository 'codeready-builder-for-rhel-8-x86_64-eus-debug-rpms':
  - Status code: 404 for https://cdn.redhat.com/content/eus/rhel8/8.7/x86_64/codeready-builder/debug/repodata/repomd.xml (IP: 104.82.76.83)
Error: Failed to download metadata for repo 'codeready-builder-for-rhel-8-x86_64-eus-debug-rpms': Cannot download repomd.xml: Cannot download repodata/repomd.xml: All mirrors were tried

答案1

似乎您忘记在系统上启用 EPEL 存储库。向导会提醒您这一点。检查 EPEL 和 CodeReady 存储库是否都已启用。

相关内容