Php 损坏,安装时出现“持有损坏的包”错误

Php 损坏,安装时出现“持有损坏的包”错误

我已经完全毁掉了一切,现在 php 无法安装。

我使用的是 php5.4,一切都很好。然后我需要在本地运行 Magento,但它无法正常工作。

我看到其中一个要求是 php5.3,所以我使用在线找到的脚本进行了降级,但 PDO 无法正常工作。

我按照网上人们说的搞了几个小时,但最终什么也没做,所以我清除了 php,重新安装了 php5.4,从头开始,找出我的问题。

清除后,我使用重新安装 Php5apt-get 安装 php5脚本运行后我得到以下输出:

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:
 php5 : Depends: libapache2-mod-php5 (>= 5.4.9-4ubuntu2.4) but 5.3.10-1ubuntu3 is to     be installed or
                 libapache2-mod-php5filter (>= 5.4.9-4ubuntu2.4) but it is not going to be installed or
             php5-cgi (>= 5.4.9-4ubuntu2.4) but it is not going to be installed or
             php5-fpm (>= 5.4.9-4ubuntu2.4) but it is not going to be installed
    Depends: php5-common (>= 5.4.9-4ubuntu2.4) but 5.3.10-1ubuntu3 is to be installed
E: Unable to correct problems, you have held broken packages.

然后我在 Google 上搜索了很长时间,并运行了 clean、update、upgrade、-f install 等命令和其他一些命令。我回来安装 php,但还是出现同样的错误。

我怎样才能重新安装 Php 以使其再次运行。

答案1

尝试这个命令,

sudo aptitude install php5

它将php5与其依赖项一起安装。

答案2

尝试这个 :

sudo rm -r /var/lib/apt/lists/* && sudo apt-get 更新

然后尝试安装

相关内容