Не удалось установить php-mbstring

Я пытаюсь установить php-mbstring на сервере Ubuntu 18.04, который уже имеет apache2, php и установленный mariadb. Я попробовал следующей последовательностью команд:

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.

Кажется, что существует unresolveable включенная зависимость. Как я могу исправить ситуацию? Эта проблема блокирует мою попытку установить phpMyAdmin.

5
задан 12 August 2018 в 05:04

4 ответа

Мне нужно было включить юниверс в моих источниках. List

sudo vi /etc/apt/sources.list

измените файл так, чтобы он выглядел следующим образом:

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

sudo apt update
[ 116] И тогда я мог бы установить php7.2-mbstring

13
ответ дан 23 November 2019 в 08:42

У меня была такая же проблема в Ubuntu 18.04

Отредактируйте файл /etc/apt/sources.list со следующими строками:

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

Сохраните и запустите:

[ 111]

И готово

8
ответ дан 23 November 2019 в 08:42

Просто использование:

sudo apt-get install php-mbstring

Затем необходимо перезапустить Обслуживание Apache, Использование:

sudo service apache2 restart
0
ответ дан 23 November 2019 в 08:42

Все, что мне нужно было сделать, это

sudo apt-get update

, и после этого он был доступен для установки.

1
ответ дан 3 February 2021 в 13:30

Другие вопросы по тегам:

Похожие вопросы: