web-dev-qa-db-fra.com

Impossible d'installer php-mbstring

J'essaie d'installer php-mbstring sur un serveur Ubuntu 18.04 sur lequel Apache2, php et mariadb sont déjà installés. J'ai essayé avec la séquence de commandes suivante:

jonathan@samuel:~$ Sudo apt update
[Sudo] password for jonathan:
Hit:1 http://archive.ubuntu.com/ubuntu bionic InRelease
Hit:2 http://downloads.mariadb.com/MariaDB/mariadb-10.3/repo/ubuntu bionic InRelease
Get:3 http://archive.ubuntu.com/ubuntu bionic-security InRelease [83.2 kB]
Ign:4 http://downloads.mariadb.com/MaxScale/2.2/ubuntu bionic InRelease
Hit:5 http://downloads.mariadb.com/Tools/ubuntu bionic InRelease
Get:6 http://archive.ubuntu.com/ubuntu bionic-updates InRelease [88.7 kB]
Hit:7 http://downloads.mariadb.com/MaxScale/2.2/ubuntu bionic Release
Fetched 172 kB in 2s (91.6 kB/s)
Reading package lists... Done
Building dependency tree
Reading state information... Done
All packages are up to date.
jonathan@samuel:~$ Sudo apt install php-mbstring
Reading package lists... Done
Building dependency tree
Reading state information... Done
Some packages could not be installed. This may mean that you have
requested an impossible situation or if you are using the unstable
distribution that some required packages have not yet been created
or been moved out of Incoming.
The following information may help to resolve the situation:

The following packages have unmet dependencies:
 php-mbstring : Depends: php7.2-mbstring but it is not going to be installed
E: Unable to correct problems, you have held broken packages.
jonathan@samuel:~$ Sudo apt -f install php7.2-mbstring
Reading package lists... Done
Building dependency tree
Reading state information... Done
Some packages could not be installed. This may mean that you have
requested an impossible situation or if you are using the unstable
distribution that some required packages have not yet been created
or been moved out of Incoming.
The following information may help to resolve the situation:

The following packages have unmet dependencies:
 php7.2-mbstring : Depends: php7.2-common (= 7.2.3-1ubuntu1) but 7.2.7-0ubuntu0.18.04.2 is to be installed
E: Unable to correct problems, you have held broken packages.

Il semble qu’une dépendance insoluble soit en cause. Comment puis-je corriger la situation? Ce problème bloque ma tentative d'installation de phpMyAdmin.

4
Jonathan

Je devais activer l'univers dans mon sources.list

Sudo vi /etc/apt/sources.list

changez le fichier pour qu'il ressemble à ceci:

deb http://archive.ubuntu.com/ubuntu bionic main universe
deb http://archive.ubuntu.com/ubuntu bionic-security main universe
deb http://archive.ubuntu.com/ubuntu bionic-updates main universe

apt-get mis à jour

Sudo apt update

Et puis je pourrais installer php7.2-mbstring

8
bradhancock

J'ai eu le même problème dans Ubuntu 18.04

Editez le fichier /etc/apt/sources.list avec les lignes suivantes:

deb http://archive.ubuntu.com/ubuntu bionic main multiverse restricted universe
deb http://archive.ubuntu.com/ubuntu bionic-security main multiverse restricted universe
deb http://archive.ubuntu.com/ubuntu bionic-updates main multiverse restricted universe

Enregistrer et exécuter:

Sudo apt update && Sudo apt-get upgrade
Sudo apt-get install php7.2-mbstring

Et c'est fait

5
Jorgeee