Acho que desinstalar o PHP existente primeiro deve corrigir o problema.
$ sudo apt-get remove php5*
Eu tenho um OVH VPS que executa o php 5.3. Eu gostaria de atualizar para o PHP 5.6. Eu usei essa solução ( Como faço para atualizar do PHP 5.3 para o PHP 5.4.6 no Ubuntu? :
sudo add-apt-repository ppa:ondrej/php5-5.6
sudo apt-get update
sudo apt-get install php5
mas tenho este erro:
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).
Você poderia me ajudar nas próximas etapas? Muito obrigado.
EDITAR
Quando executo sudo apt-get -f install
, recebo o seguinte erro:
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)
Acho que desinstalar o PHP existente primeiro deve corrigir o problema.
$ sudo apt-get remove php5*