PHP安装:错误:无法切换模块的启用流

10

我正在尝试使用以下命令在CentOS 8中将PHP从7.2升级到最新的7.4版本:

rpm -Uvh https://dl.fedoraproject.org/pub/epel/epel-release-latest-8.noarch.rpm

dnf install -y https://rpms.remirepo.net/enterprise/remi-release-8.rpm

dnf module list php

但是当我执行这个命令:dnf module enable php:remi-7.4 -y

我会收到以下错误信息:

Last metadata expiration check: 0:05:44 ago on Fri 24 Jul 2020 08:56:07 PM CEST.
Dependencies resolved.
The operation would result in switching of module 'php' stream '7.2' to stream 'remi-7.4'
Error: It is not possible to switch enabled streams of a module.
It is recommended to remove all installed content from the module, and reset the module using 'dnf module reset <module_name>' command. After you reset the module, you can install the other stream.

我该如何解决这个问题?


你可以投票,但是PHP并不是一项服务。 - Luis Alfredo Serrano Díaz
1个回答

36

正如向导说明所述,并且如复制的错误信息中所解释的那样,您需要在启用新版本之前禁用旧版本流:

dnf module reset php
dnf module install php:remi-7.4
dnf update

是否可能在保留 7.2 作为默认系统版本的同时安装多个版本?我正在使用 Virtualmin,所以希望拥有可用的 7.3 和 7.4 版本,并保持 7.2 作为默认版本。类似于 CentOS 7 中的软件集合。 - Chris Wheeler
1
是的,在我的代码库中仍然可以找到SCL,请查看向导说明。 - Remi Collet

网页内容由stack overflow 提供, 点击上面的
可以查看英文原文,
原文链接