Debian 9 PHP7.4无法安装curl

Debian 9 PHP7.4无法安装curl

我已经搜索了这个问题的答案并检查了Bartek Chanda 回答,但对我不起作用。我有 Debian 9.13,并且已经按照 Bartek Chanda 的回答做了,但不起作用。

仍然出现此错误:

php7.4-curl : Depends: php7.4-common (= 7.4.18-2+ubuntu21.04.1+deb.sury.org+3) but 7.4.12-3+0~20201103.32+debian9~1.gbpa97e22 is to be installed

Depends: libcurl4 (>= 7.56.1) but it is not installable
E: Unable to correct problems, you have held broken packages.

答案1

您说您有 Debian 9,但您似乎添加了用于 Ubuntu 21.04 的 apt 源。删除它并用正确的 apt 源替换它,然后重试。

答案2

尝试:

sudo apt update
sudo apt upgrade -y && sudo reboot
sudo apt -y install lsb-release apt-transport-https ca-certificates 
sudo wget -O /etc/apt/trusted.gpg.d/php.gpg https://packages.sury.org/php/apt.gpg
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 -y install php7.4

有关详细信息,请参阅关联

相关内容