web-dev-qa-db-fra.com

php7 sur Ubuntu 16.04 pas entièrement configuré. - 21 problèmes de dépendance dpkg

Je suis passé de 14.04 à 16.04. le serveur est opérationnel mais dpkg a 21 erreurs de dépendance que je ne peux pas résoudre et empêche l’installation de nouveaux paquets et la construction de nouveaux sites Web.

J'ai enlevé la liste avec

Sudo rm -rf /var/lib/apt/lists/*
Sudo apt-get update
Sudo apt-get upgrade

et c'est là que les erreurs commencent

$ Sudo apt-get upgrade
Reading package lists... Done
Building dependency tree       
Reading state information... Done
Calculating upgrade... Done
0 upgraded, 0 newly installed, 0 to remove and 0 not upgraded.
21 not fully installed or removed.
After this operation, 0 B of additional disk space will be used.
Do you want to continue? [Y/n] y
Setting up php7.0-common (7.0.11-1+deb.sury.org~xenial+1) ...
dpkg: error processing package php7.0-common (--configure):
 subprocess installed post-installation script returned error exit status 10
dpkg: dependency problems prevent configuration of php7.0-json:
 php7.0-json depends on php7.0-common (= 7.0.11-1+deb.sury.org~xenial+1); however:
  Package php7.0-common is not configured yet.

dpkg: error processing package php7.0-json (--configure):
 dependency problems - leaving unconfigured
dpkg: dependency problems prevent configuration of php7.0-opcache:
 php7.0-opcache depends on php7.0-common (= 7.0.11-1+deb.sury.org~xenial+1); however:
  Package php7.0-common is not configured yet.

dpkg: error processing package php7.0-opcache (--configure):
 dependency problems - leaving unconfigured
No apport report written because the error message indicates its a followup error from a previous failure.
No apport report written because the error message indicates its a followup error from a previous failure.

dpkg: dependency problems prevent configuration of php7.0-readline:
 php7.0-readline depends on php7.0-common (= 7.0.11-1+deb.sury.org~xenial+1); however:
  Package php7.0-common is not configured yet.

dpkg: error processing package php7.0-readline (--configure):
 dependency problems - leaving unconfigured
No apport report written because MaxReports is reached already
dpkg: dependency problems prevent configuration of php7.0-cli:
 php7.0-cli depends on php7.0-common (= 7.0.11-1+deb.sury.org~xenial+1); however:
  Package php7.0-common is not configured yet.
 php7.0-cli depends on php7.0-json; however:
  Package php7.0-json is not configured yet.
 php7.0-cli depends on php7.0-opcache; however:
  Package php7.0-opcache is not configured yet.
 php7.0-cli depends on php7.0-readline; however:
  Package php7.0-readline is not configured yet.

dpkg: error processing package php7.0-cli (--configure):
 dependency problems - leaving unconfigured
No apport report written because MaxReports is reached already
dpkg: dependency problems prevent configuration of libapache2-mod-php7.0:
 libapache2-mod-php7.0 depends on php7.0-cli; however:
  Package php7.0-cli is not configured yet.
 libapache2-mod-php7.0 depends on php7.0-common (= 7.0.11-1+deb.sury.org~xenial+1); however:
  Package php7.0-common is not configured yet.
 libapache2-mod-php7.0 depends on php7.0-json; however:
  Package php7.0-json is not configured yet.
 libapache2-mod-php7.0 depends on php7.0-opcache; however:
  Package php7.0-opcache is not configured yet.

dpkg: error processing package libapache2-mod-php7.0 (--configure):
 dependency problems - leaving unconfigured
No apport report written because MaxReports is reached already
dpkg: dependency problems prevent configuration of libapache2-mod-php:
 libapache2-mod-php depends on libapache2-mod-php7.0; however:
  Package libapache2-mod-php7.0 is not configured yet.

dpkg: error processing package libapache2-mod-php (--configure):
 dependency problems - leaving unconfigured
No apport report written because MaxReports is reached already
dpkg: dependency problems prevent configuration of php7.0-Gd:
 php7.0-Gd depends on php7.0-common (= 7.0.11-1+deb.sury.org~xenial+1); however:
  Package php7.0-common is not configured yet.

dpkg: error processing package php7.0-Gd (--configure):
 dependency problems - leaving unconfigured
No apport report written because MaxReports is reached already
dpkg: dependency problems prevent configuration of php-Gd:
 php-Gd depends on php7.0-Gd; however:
  Package php7.0-Gd is not configured yet.

dpkg: error processing package php-Gd (--configure):
 dependency problems - leaving unconfigured
No apport report written because MaxReports is reached already
dpkg: dependency problems prevent configuration of php7.0-xml:
 php7.0-xml depends on php7.0-common (= 7.0.11-1+deb.sury.org~xenial+1); however:
  Package php7.0-common is not configured yet.

dpkg: error processing package php7.0-xml (--configure):
 dependency problems - leaving unconfigured
No apport report written because MaxReports is reached already
dpkg: dependency problems prevent configuration of php-xml:
 php-xml depends on php7.0-xml; however:
  Package php7.0-xml is not configured yet.

dpkg: error processing package php-xml (--configure):
 dependency problems - leaving unconfigured
No apport report written because MaxReports is reached already
dpkg: dependency problems prevent configuration of php-pear:
 php-pear depends on php-cli; however:
  Package php-cli is not installed.
  Package php7.0-cli which provides php-cli is not configured yet.
 php-pear depends on php-xml; however:
  Package php-xml is not configured yet.
  Package php7.0-xml which provides php-xml is not configured yet.

dpkg: error processing package php-pear (--configure):
 dependency problems - leaving unconfigured
No apport report written because MaxReports is reached already
dpkg: dependency problems prevent configuration of php-gettext:
 php-gettext depends on php-pear; however:
  Package php-pear is not configured yet.

dpkg: error processing package php-gettext (--configure):
 dependency problems - leaving unconfigured
No apport report written because MaxReports is reached already
dpkg: dependency problems prevent configuration of php7.0-mbstring:
 php7.0-mbstring depends on php7.0-common (= 7.0.11-1+deb.sury.org~xenial+1); however:
  Package php7.0-common is not configured yet.

dpkg: error processing package php7.0-mbstring (--configure):
 dependency problems - leaving unconfigured
No apport report written because MaxReports is reached already
No apport report written because MaxReports is reached already
dpkg: dependency problems prevent configuration of php-mbstring:
 php-mbstring depends on php7.0-mbstring; however:
  Package php7.0-mbstring is not configured yet.

dpkg: error processing package php-mbstring (--configure):
 dependency problems - leaving unconfigured
dpkg: dependency problems prevent configuration of php7.0-mcrypt:
 php7.0-mcrypt depends on php7.0-common (= 7.0.11-1+deb.sury.org~xenial+1); however:
  Package php7.0-common is not configured yet.

dpkg: error processing package php7.0-mcrypt (--configure):
 dependency problems - leaving unconfigured
No apport report written because MaxReports is reached already
No apport report written because MaxReports is reached already
dpkg: dependency problems prevent configuration of php-mcrypt:
 php-mcrypt depends on php7.0-mcrypt; however:
  Package php7.0-mcrypt is not configured yet.

dpkg: error processing package php-mcrypt (--configure):
 dependency problems - leaving unconfigured
dpkg: dependency problems prevent configuration of php7.0-mysql:
 php7.0-mysql depends on php7.0-common (= 7.0.11-1+deb.sury.org~xenial+1); however:
  Package php7.0-common is not configured yet.

dpkg: error processing package php7.0-mysql (--configure):
 dependency problems - leaving unconfigured
No apport report written because MaxReports is reached already
dpkg: dependency problems prevent configuration of php-mysql:
 php-mysql depends on php7.0-mysql; however:
  Package php7.0-mysql is not configured yet.

dpkg: error processing package php-mysql (--configure):
 dependency problems - leaving unconfigured
No apport report written because MaxReports is reached already
dpkg: dependency problems prevent configuration of php7.0-curl:
 php7.0-curl depends on php7.0-common (= 7.0.11-1+deb.sury.org~xenial+1); however:
  Package php7.0-common is not configured yet.

dpkg: error processing package php7.0-curl (--configure):
 dependency problems - leaving unconfigured
No apport report written because MaxReports is reached already
dpkg: dependency problems prevent configuration of pkg-php-tools:
 pkg-php-tools depends on php-pear; however:
  Package php-pear is not configured yet.
 pkg-php-tools depends on php-cli; however:
  Package php-cli is not installed.
  Package php7.0-cli which provides php-cli is not configured yet.
 pkg-php-tools depends on php-json; however:
  Package php-json is not installed.
  Package php7.0-json which provides php-json is not configured yet.
 pkg-php-tools depends on php-xml; however:
  Package php-xml is not configured yet.
  Package php7.0-xml which provides php-xml is not configured yet.

dpkg: error processing package pkg-php-tools (--configure):
 dependency problems - leaving unconfigured
No apport report written because MaxReports is reached already
Errors were encountered while processing:
 php7.0-common
 php7.0-json
 php7.0-opcache
 php7.0-readline
 php7.0-cli
 libapache2-mod-php7.0
 libapache2-mod-php
 php7.0-Gd
 php-Gd
 php7.0-xml
 php-xml
 php-pear
 php-gettext
 php7.0-mbstring
 php-mbstring
 php7.0-mcrypt
 php-mcrypt
 php7.0-mysql
 php-mysql
 php7.0-curl
 pkg-php-tools
E: Sub-process /usr/bin/dpkg returned an error code (1)

toutes les idées seraient grandement appréciées

2
Greg Smith

Ces erreurs apparaissent car vous avez supprimé/var/lib/apt/lists/*.
Si vous faites Sudo dpkg --configure -a, vous verrez aussi ces erreurs.
Si quand vous faites Sudo apt-get install php7. et vous obtenez ceci:

"Lecture des listes de paquets ... Arbre de dépendance de construction terminé
Lecture des informations sur l'état ... Terminé php7.0 est déjà la version la plus récente (7.0.19-1 + deb.sury.org ~ xenial + 2).
Les paquets suivants ont été installés automatiquement et ne sont plus nécessaires:
libmcrypt4 libpcre3-dev libpcre32-3 shtool xml2
Utilisez 'Sudo apt autoremove' pour les supprimer. 0 mis à niveau, 0 nouvellement installé, 0 à supprimer et 5 non mis à niveau. [...] "

Vous devriez faire: Sudo apt autoremove libmcrypt4
et tu verras:
"Les paquets suivants seront SUPPRIMÉS (aussi) : libmcrypt4 libpcre3-dev libpcre32-3 shtool xml2 "
... et automatiquement certains processus de déclencheurs seront exécutés et créeront de nouveaux fichiers de configuration.
Maintenant, recommencez Sudo dpkg --configure -a et aucune erreur (je pense) n'apparaîtra.
BTW. changez votre serveur de téléchargement. Si ce n'est pas le cas Recharger, pas de problème, ouvrez le terminal et faites Sudo apt-get update.

1
calebAP