为什么我无法在 Ubuntu 20.04 上安装 php7.4-intl?

tho*_*i56 5 apt dependencies php7

我需要 Ubuntu 20.04 上的 PHP INTL 模块。当我做

$ sudo apt install php7.4-intl
Run Code Online (Sandbox Code Playgroud)

我明白了

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.
Run Code Online (Sandbox Code Playgroud)

我们都知道,损坏的包裹消息是一个转移注意力的信息。(是的,我查过了……)

由于我使用的是 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
Run Code Online (Sandbox Code Playgroud)

这让我更加困惑。我已尝试通过谷歌搜索来解决 apt 配置和缓存中的任何不一致问题。( dpkg --configure -a, apt clean/autoclean, ...)

Tho*_*ard 2

php7.4-intl是从 Ubuntu 存储库安装的,而不是deb.sury您已安装并用于 PHP 的 PPA/第三方存储库。

要么不安装php-intl,要么不使用 deb.sury 存储库。如果第三方存储库中未提供任何内容,那么使用第三方存储库将阻止您安装所有内容。