2

I am trying to use command sudo apt-get upgrade command on mu ubuntu 12.04. But is is showing me the error .This is after i upgraded my php 5.4 to php5.5.

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) E: Unmet dependencies. Try using -f.

then i ran the command

sudo apt-get install -f

to fix the dependency issue and it is also giving me the error

 Unpacking apache2-bin (from
 .../apache2-bin_2.4.16-3+deb.sury.org~precise+1_amd64.deb) ... dpkg:
 error processing
 /var/cache/apt/archives/apache2-bin_2.4.16-3+deb.sury.org~precise+1_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
 Unpacking apache2-data (from
 .../apache2-data_2.4.16-3+deb.sury.org~precise+1_all.deb) ... dpkg:
 error processing
 /var/cache/apt/archives/apache2-data_2.4.16-3+deb.sury.org~precise+1_all.deb
 (--unpack):  trying to overwrite '/usr/share/apache2/icons/a.png',
 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
 Preparing to replace apache2 2.2.22-1ubuntu1.10 (using
 .../apache2_2.4.16-3+deb.sury.org~precise+1_amd64.deb) ... Unpacking
 replacement apache2 ... dpkg: error processing
 /var/cache/apt/archives/apache2_2.4.16-3+deb.sury.org~precise+1_amd64.deb
 (--unpack):  trying to overwrite
 '/usr/share/apache2/ask-for-passphrase', 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-3+deb.sury.org~precise+1_amd64.deb
 /var/cache/apt/archives/apache2-data_2.4.16-3+deb.sury.org~precise+1_all.deb
 /var/cache/apt/archives/apache2_2.4.16-3+deb.sury.org~precise+1_amd64.deb
 E: Sub-process /usr/bin/dpkg returned an error code (1)
  • But the command should be apt-get -f install @ShowStopper – Chromium Aug 28 '15 at 8:20
  • will it make any diffrence?? – Manoj Kumar Aug 28 '15 at 8:21
  • add the output of sudo dpkg --configure -a – orvi Aug 28 '15 at 11:15
7

I had the same problem. Got it working by running the following:

sudo dpkg -i --force-overwrite /var/cache/apt/archives/apache2-bin_2.4.16-3+deb.sury.org~precise+1_amd64.deb
sudo dpkg -i --force-overwrite /var/cache/apt/archives/apache2-data_2.4.16-3+deb.sury.org~precise+1_all.deb
sudo dpkg -i --force-overwrite /var/cache/apt/archives/apache2_2.4.16-3+deb.sury.org~precise+1_amd64.deb

After that sudo "apt-get -f install" worked fine!

  • pretty good hint – Fr0zenFyr Oct 16 '15 at 9:52
1

Add repository with

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

Remove all previous php versions. Then install freshly a version of your preference. Then add modules php-cgi for cgi and fcgi.

Now you would be able to use FCGI and cgi scripts. mod_apache will be a problem but you would be able to use this. Make sure to restart apache after installing php-cgi

protected by Kaz Wolfe Jan 15 '17 at 6:10

Thank you for your interest in this question. Because it has attracted low-quality or spam answers that had to be removed, posting an answer now requires 10 reputation on this site (the association bonus does not count).

Would you like to answer one of these unanswered questions instead?

Not the answer you're looking for? Browse other questions tagged or ask your own question.