我跑了apt-get dist-upgrade,我的php停止工作

时间:2018-03-10 04:35:27

标签: php debian upgrade apt-get server-configuration

我已经搜索过但无法找到有用的资源,所以我必须大声说出来。请帮我。我错误地跑了sudo apt-get upgrade -u dist-upgrade 之后,我服务器上的所有网站都停止了工作。我尝试通过键入php -v来检查Php是否仍然安装,但我得到了

-bash: php: command not found

我还尝试使用

重新安装php

sudo apt-get install php

我看到了这个

sudo apt-get install php
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:
php : Depends: php7.2 but it is not going to be installed
E: Unable to correct problems, you have held broken packages.

然后我尝试了

Sudo apt-get install php7.2

我看到了这个

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.2 : Depends: libapache2-mod-php7.2 but it is not going to be installed or
                   php7.2-fpm but it is not going to be installed or
                   php7.2-cgi but it is not going to be installed
E: Unable to correct problems, you have held broken packages.

我也试过安装模块:我明白了:

root@matrixpluspluto:~# sudo apt-get install php7.2 php7.2-cli php7.2-c
gi php7.2-fpm libapache2-mod-php7.2 php7.2-opcache
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:
 libapache2-mod-php7.2 : Depends: libc6 (>= 2.27) but 2.24-11+deb9u1 is to be installed
                         Depends: libsodium23 (>= 1.0.14) but it is not going to be installed
 php7.2-cgi : Depends: libc6 (>= 2.27) but 2.24-11+deb9u1 is to be installed
              Depends: libsodium23 (>= 1.0.14) but it is not going to be installed
 php7.2-cli : Depends: libc6 (>= 2.27) but 2.24-11+deb9u1 is to be installed
              Depends: libsodium23 (>= 1.0.14) but it is not going to be installed
 php7.2-fpm : Depends: libc6 (>= 2.27) but 2.24-11+deb9u1 is to be installed
              Depends: libsodium23 (>= 1.0.14) but it is not going to be installed
 php7.2-opcache : Depends: libc6 (>= 2.27) but 2.24-11+deb9u1 is to be installed
E: Unable to correct problems, you have held broken packages.

我查了一下,发现已经安装了libc6 v2.24 请帮我。在此之前,我在升级后使用php7.1,我开始看到7.2。我做的关于php的任何事情都没有成功。 Pove一直试图解决这个问题超过2天,请帮忙。

1 个答案:

答案 0 :(得分:0)

不知道你是否解决了它,但我遇到了同样的问题。

通过运行解决它: sudo apt-get purge php *

请注意,这不是一个好的解决方案,而是一个绝望的解决方案。我也知道我安装了什么与php相关的软件包,所以我不会害怕命令会清除什么。 然后,我看到了哪些包被清除,重新绑定它们。 一切都工作正常。