我最近从 debian9 (stretch) 升级到了 debian10 (buster)。其中还包括升级到 php7.4。由于某种原因,php-curl 无法安装。
我运行apt install php7.4-curl
并收到错误:
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-curl : Depends: libcurl3 (>= 7.44.0) but it is not installable
E: Unable to correct problems, you have held broken packages.
我看不到任何被扣留的包裹。我尝试过:
apt-mark showhold
dpkg --audit
dpkg --configure -a
apt-get install -f
apt-get clean
apt-get update
apt-get autoremove
我也尝试过删除 curl、purge、autoremove,然后重新安装。还是一样。
我尝试安装 libcurl3
Package libcurl3 is not available, but is referred to by another package.
This may mean that the package is missing, has been obsoleted, or
is only available from another source
However the following packages replace it:
libcurl4
答案1
debian10 附带 php7.3,而不是 php7.4
https://packages.debian.org/search?suite=all&arch=any&searchon=names&keywords=php7
php 7.4 将出现在下一个 debian 11 中(bullseye)。
您可以添加一些非 Debian 存储库:
wget -qO - https://packages.sury.org/php/apt.gpg | sudo apt-key add -
echo "deb https://packages.sury.org/php/ $(lsb_release -sc) main" | sudo tee /etc/apt/sources.list.d/php.list
sudo apt update
sudo apt install php7.4 php7.4-curl