Installation 安装PHP7.4时遇到;“未满足的依赖关系”;,如何解决这个问题?

Installation 安装PHP7.4时遇到;“未满足的依赖关系”;,如何解决这个问题?,installation,ubuntu-20.04,php-7.4,Installation,Ubuntu 20.04,Php 7.4,我知道很多话题都有同样的问题,但我已经尝试了所有的方法,但没有一种方法对我有效。 所以我正试图在我的ubuntu上安装PHP7.4。我执行了在Internet上找到的以下命令: apt install ca-certificates apt-transport-https wget gnupg wget -q https://packages.sury.org/php/apt.gpg -O- | apt-key add - echo "deb https://packages.sury

我知道很多话题都有同样的问题,但我已经尝试了所有的方法,但没有一种方法对我有效。 所以我正试图在我的ubuntu上安装PHP7.4。我执行了在Internet上找到的以下命令:

apt install ca-certificates apt-transport-https wget gnupg
wget -q https://packages.sury.org/php/apt.gpg -O- | apt-key add -
echo "deb https://packages.sury.org/php/ buster main" | tee /etc/apt/sources.list.d/php.list
apt update
apt install php7.4
然后我得到一个错误:

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 : Depends: libapache2-mod-php7.4 but it is not going to be installed or
                   php7.4-fpm but it is not going to be installed or
                   php7.4-cgi but it is not going to be installed
          Depends: php7.4-common but it is not going to be installed
E: Unable to correct problems, you have held broken packages.
我看到有人跟踪错误,试图安装导致问题的依赖项。于是我就这么做了

apt install php7.4-common
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-common : Depends: libc6 (>= 2.27) but 2.24-11+deb9u4 is to be installed
E: Unable to correct problems, you have held broken packages.
我在某处看到它可能是我的/etc/apt/sources.list中的某个东西,所以它是:

# Generated by distrobuilder
deb http://deb.debian.org/debian stretch main
deb http://security.debian.org/debian-security stretch/updates main

我被卡住了,我不知道怎么了。你能帮忙吗?谢谢

如果您对PHPV7.4没有特定的依赖关系,您可以尝试安装v7.3,这样就可以了。我在我的Kali Linux中遇到了同样的问题,但因为我只需要PHP而不是特定的版本,所以安装7.3对我来说是可行的

您可以通过
sudo apt get install php7.3实现这一点