我需要 Ubuntu 20.04 上 PHP 的 INTL 模块。当我做
$ sudo apt install php7.4-intl
我明白了
Reading package lists... Done
Building dependency tree
Reading state information... Done
Some packages could not be installed. This may mean that you have
requested an impossible situation or if you are using the unstable
distribution that some required packages have not yet been created
or been moved out of Incoming.
The following information may help to resolve the situation:
The following packages have unmet dependencies:
php7.4-intl : Depends: php7.4-common (= 7.4.3-4ubuntu2.2) but 7.4.8-1+ubuntu19.10.1+deb.sury.org+3 is to be installed
E: Unable to correct problems, you have held broken packages.
我们都知道,损坏的包裹消息是一条红鲱鱼。(是的,我检查了...)
当我在 20.04 时,我对包装中建议的ubuntu19.10.1
部分持怀疑态度。apt
PHP 说:
PHP 7.4.8 (cli) (built: Jul 13 2020 16:46:06) ( NTS )
Copyright (c) The PHP Group
Zend Engine v3.4.0, Copyright (c) Zend Technologies
with Zend OPcache v7.4.8, Copyright (c), by Zend Technologies
这让我更加困惑。我已经尝试了我可以找到的谷歌搜索来纠正 apt 配置和缓存中的任何不一致。( dpkg --configure -a
, apt clean/autoclean
, ...)
php7.4-intl
正在从 Ubuntu 存储库安装,而不是deb.sury
您已安装并用于 PHP 的 PPA/第三方存储库。要么不安装
php-intl
,要么不使用 deb.sury 存储库。如果第三方存储库中未提供所有内容,则使用第三方存储库将阻止您安装所有内容。