Ubuntu 12.04 PHP 5.3 至 5.5 更新失败

Ubuntu 12.04 PHP 5.3 至 5.5 更新失败

在 Ubuntu 12.04 服务器上,我尝试将 PHP 5.3 更新到 5.5,这是我所做的:

sudo add-apt-repository ppa:ondrej/php5
sudo apt-get update
sudo apt-get install php5

不幸的是,安装以以下错误结束:

dpkg: error processing /var/cache/apt/archives/apache2-bin_2.4.16-4+deb.sury.org~precise+4_amd64.deb (--unpack):
 trying to overwrite '/usr/share/man/man8/apache2.8.gz', which is also in package apache2.2-common 2.2.22-1ubuntu1.10
dpkg-deb (subprocess): subprocess data was killed by signal (Broken pipe)
dpkg-deb: error: subprocess <decompress> returned error exit status 2
Processing triggers for man-db ...
Errors were encountered while processing:
 /var/cache/apt/archives/apache2-bin_2.4.16-4+deb.sury.org~precise+4_amd64.deb
E: Sub-process /usr/bin/dpkg returned an error code (1)

看来 PHP 5 也影响了 Apache 2.2。谢谢帮助,为什么子进程被终止了。

编辑:我通过完全卸载 apache2.2 并重新安装 2.4 解决了这个问题,并且没有任何错误。

答案1

我在升级 PHP 时遇到了同样的问题,你可以尝试这个

sudo dpkg -i --force-overwrite /var/cache/apt/archives/apache2-bin_2.4.16-4+deb.sury.org~precise+4_amd64.deb

然后安装 php5

sudo apt-get -f install php5

这将升级 apache2,请尽情享受。

相关内容