web-dev-qa-db-fra.com

Pas de mise à jour vers "apt-get update"

J'essayais de mettre à jour les paquets PHP sur mon serveur Ubuntu 14.04 LTS et je continue à avoir des erreurs. Je sais qu'il y a une copie de ce Qn mais j'ai supprimé le fichier d'erreur provoquant de/var/cache/apt/archives/mais cela n'a pas fonctionné.

J'ai couru ces commandes:

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

Puis j'ai eu ceci:

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)
2
hpb

Vous devez d’abord supprimer le paquet Apache2.2-common

Sudo apt-get remove Apache2.2-common

et peut-être un peu plus avant de pouvoir utiliser le PPA ppa:ondrej/php5.


Si vous voyez un message d'erreur comme celui-ci

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

supprimez le package nommé entre which is also in package et la version, par exemple. 2.2.22-1ubuntu1.10.

1
A.B.