首页
学习
活动
专区
圈层
工具
发布
首页
学习
活动
专区
圈层
工具
MCP广场
社区首页 >问答首页 >安装PHP 7.4遇到“未满足的依赖”,如何解决这个问题?

安装PHP 7.4遇到“未满足的依赖”,如何解决这个问题?
EN

Stack Overflow用户
提问于 2020-07-24 07:28:41
回答 2查看 4.2K关注 0票数 6

我知道很多话题都有同样的问题,但我已经尝试了所有的方法,但都没有对我起作用。所以我试着在我的ubuntu上安装php 7.4。我已经执行了我在互联网上找到的以下命令:

代码语言:javascript
运行
AI代码解释
复制
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

然后我得到了错误:

代码语言:javascript
运行
AI代码解释
复制
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.

我看到有人通过尝试安装导致问题的驱动程序来跟踪错误。所以我就这么做了

代码语言:javascript
运行
AI代码解释
复制
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/Sourcees.list中,所以它是这样的:

代码语言:javascript
运行
AI代码解释
复制
# Generated by distrobuilder
deb http://deb.debian.org/debian stretch main
deb http://security.debian.org/debian-security stretch/updates main

我卡住了,我看不出有什么问题。你能帮忙吗?谢谢

EN

回答 2

Stack Overflow用户

发布于 2021-09-20 01:37:27

请尝试Ubuntu的以下命令:

代码语言:javascript
运行
AI代码解释
复制
sudo apt install software-properties-common
sudo add-apt-repository ppa:ondrej/php
sudo apt update
票数 4
EN

Stack Overflow用户

发布于 2020-10-29 04:26:37

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

您可以使用sudo apt-get install php7.3实现这一点

票数 -1
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/63068843

复制
相关文章

相似问题

领券
💥开发者 MCP广场重磅上线!
精选全网热门MCP server,让你的AI更好用 🚀
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档