2

I was trying to upgrade the PHP packages on my Ubuntu 14.04 LTS server and I keep getting errors. I know there is a duplicate of this Qn but i removed the error causing file from /var/cache/apt/archives/ but it did not work.

I ran these commands:

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

Then I got this:

Reading package lists... Done
Building dependency tree       
Reading state information... Done
Correcting dependencies... Done
The following packages will be REMOVED:
  apache2-mpm-prefork apache2.2-bin apache2.2-common php5-dev php5-gd
The following NEW packages will be installed:
  apache2-bin apache2-data libjson-c2 php5-json php5-ssh2
The following packages have been kept back:
  libgd2-xpm-dev libssl-dev openssl
The following packages will be upgraded:
  apache2 libssh2-php php-pear php5 php5-cli php5-common php5-curl php5-fpm php5-mcrypt php5-mysql
10 upgraded, 5 newly installed, 5 to remove and 3 not upgraded.
1 not fully installed or removed.
Need to get 375 kB/8007 kB of archives.
After this operation, 2457 kB disk space will be freed.
Do you want to continue [Y/n]? y
Get:1 http://ppa.launchpad.net/ondrej/php5/ubuntu/ precise/main php-pear all 5.5.30+dfsg-1+deb.sury.org~precise+1 [373 kB]
Get:2 http://ppa.launchpad.net/ondrej/php5/ubuntu/ precise/main php5 all 5.5.30+dfsg-1+deb.sury.org~precise+1 [1220 B]
Fetched 375 kB in 0s (1074 kB/s)
perl: warning: Setting locale failed.
perl: warning: Please check that your locale settings:
    LANGUAGE = "en_US:en",
    LC_ALL = (unset),
    LC_CTYPE = "UTF-8",
    LANG = "en_US.UTF-8"
    are supported and installed on your system.
perl: warning: Falling back to the standard locale ("C").
locale: Cannot set LC_CTYPE to default locale: No such file or directory
locale: Cannot set LC_ALL to default locale: No such file or directory
(Reading database ... 96522 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.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)
hpb
  • 23
  • 5

1 Answers1

1

First you have to remove the package apache2.2-common

sudo apt-get remove apache2.2-common

and perhaps some more, before you can use the PPA ppa:ondrej/php5.


If you see an error message like this

trying to overwrite '/usr/share/man/man8/apache2.8.gz', which is also in package apache2.2-common 2.2.22-1ubuntu1.10

remove the package which is named between which is also in package and the version, e.g. 2.2.22-1ubuntu1.10.

A.B.
  • 90,397
  • Would deleting the file /usr/share/man/man8/apache2.8.gz fix the problem or would it case more problems i am just wondering. – Neil Nov 10 '15 at 09:39
  • 2
    No, it wouldn't fix the problem. Your problem is a package manager thing and not a thing of installed files. In your comment above, it's only the man page, but never remove installed files in this way without a good reason. – A.B. Nov 10 '15 at 09:43