我有一个运行PHP 5.3的OVH VPS。 我想更新到PHP 5.6。 我已经使用了这个解决scheme( 如何在Ubuntu中从PHP 5.3升级到PHP 5.4.6 ):
sudo add-apt-repository ppa:ondrej/php5-5.6 sudo apt-get update sudo apt-get install php5
但我有这个错误:
Reading package lists... Done Building dependency tree Reading state information... Done You might want to run 'apt-get -f install' to correct these: The following packages have unmet dependencies: libapache2-mod-php5 : Depends: apache2-api-20120211 Depends: apache2 (>= 2.4) Depends: php5-common (= 5.6.18+dfsg-1+deb.sury.org~precise+1) but 5.3.10-1ubuntu3.15 is to be installed libapache2-mod-wsgi-py3 : Depends: apache2-api-20120211 php5 : Depends: php5-common (>= 5.6.18+dfsg-1+deb.sury.org~precise+1~) but 5.3.10-1ubuntu3.15 is to be installed E: Unmet dependencies. Try 'apt-get -f install' with no packages (or specify a solution).
你能帮我在下面的步骤? 非常感谢你。
编辑
当我运行sudo apt-get -f install ,出现以下错误:
Get:24 http://ppa.launchpad.net/ondrej/php5-5.6/ubuntu/ precise/main pkg-php-tools all 1.21+deb.sury.org~precise+1 [38.7 kB] Fetched 7,138 kB in 0s (13.8 MB/s) (Reading database ... 77021 files and directories currently installed.) Unpacking apache2-bin (from .../apache2-bin_2.4.16-4+deb.sury.org~precise+4_amd64.deb) ... 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.7 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应该解决这个问题。
$ sudo apt-get remove php5*