【问题标题】:How do I reinstall PHP after fail upgrade?升级失败后如何重新安装 PHP?
【发布时间】:2015-08-13 17:13:01
【问题描述】:

在 Ubuntu 14.04 上,我使用了来自 ondrej PPA 的 PHP 5.5。 我想升级到 PHP 5.6。

添加了新的 PPA,apt-get update && apt-get upgradephp5-json 出现故障。 我已经清除了所有 PHP、所有 PHP PPA 存储库,删除了 /etc/php5 /usr/lib/php5 /var/lib/php5

添加了 PHP 5.6 PPA - 下一步:

➜  ~  sudo apt-get install php5-json
Reading package lists... Done
Building dependency tree
Reading state information... Done
The following extra packages will be installed:
  php5-common
Suggested packages:
  php5-user-cache
The following NEW packages will be installed:
  php5-common php5-json
0 upgraded, 2 newly installed, 0 to remove and 5 not upgraded.
Need to get 0 B/728 kB of archives.
After this operation, 1,331 kB of additional disk space will be used.
Do you want to continue? [Y/n]
Selecting previously unselected package php5-common.
(Reading database ... 182833 files and directories currently installed.)
Preparing to unpack .../php5-common_5.6.11+dfsg-1+deb.sury.org~trusty+1_amd64.deb ...
Unpacking php5-common (5.6.11+dfsg-1+deb.sury.org~trusty+1) ...
Selecting previously unselected package php5-json.
Preparing to unpack .../php5-json_1.3.7-1+deb.sury.org~trusty+1_amd64.deb ...
Unpacking php5-json (1.3.7-1+deb.sury.org~trusty+1) ...
Setting up php5-common (5.6.11+dfsg-1+deb.sury.org~trusty+1) ...

Creating config file /etc/php5/mods-available/pdo.ini with new version

Creating config file /etc/php5/mods-available/opcache.ini with new version
dpkg: dependency problems prevent configuration of php5-json:
 php5-json depends on phpapi-20121212; however:
  Package phpapi-20121212 is not installed.

dpkg: error processing package php5-json (--configure):
 dependency problems - leaving unconfigured
No apport report written because the error message indicates its a followup error from a previous failure.
                                                                                                          Errors were encountered while processing:
 php5-json
E: Sub-process /usr/bin/dpkg returned an error code (1)

我该如何解决这个问题?

【问题讨论】:

  • 你可以尝试专门清除 php5-json 包并给我们输出吗?
  • @AedixRhinedale 谢谢你的帮助,我找到了解决办法,贴在下面。

标签: php php-5.5 php-5.6


【解决方案1】:

问题解决:

sudo apt-get clean
sudo apt-get update
sudo apt-get upgrade

【讨论】:

    猜你喜欢
    • 2021-01-19
    • 2014-11-26
    • 1970-01-01
    • 2021-02-28
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2018-03-17
    相关资源
    最近更新 更多