1

I have a OVH VPS which runs php 5.3. I would like to update to php 5.6. I've used this solution (How do I upgrade from PHP 5.3 to PHP 5.4.6 in Ubuntu?) :

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

but I have this error :

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).

Could you help me in the following steps ? Thank you very much.

EDIT

When I run sudo apt-get -f install I get the following error :

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)
Reveclair
  • 119
  • 1
  • 3

1 Answers1

0

I think uninstalling the existing PHP first should fix the issue.

$ sudo apt-get remove php5*
ColinM
  • 701
  • 8
  • 19
  • Thank you for your answer, but when I run this command, at the end, I get `The following packages have unmet dependencies: libapache2-mod-wsgi-py3 : Depends: apache2-api-20120211 E: Unmet dependencies. Try 'apt-get -f install' with no packages (or specify a solution)`. Any ideas what I should do ? Thank you ! – Reveclair Feb 16 '16 at 09:46
  • @Reveclair libapache2-mod-wsgi-py3 is not related to PHP in any way so I'd assume removing it would fix the issue but I don't know offhand how to resolve the dependency without removing it. – ColinM Feb 17 '16 at 19:59