2

I'm using ubuntu 18.04. I'm trying to install mbstring but terminall show error:

php-mbstring : Depends: php7.2-mbstring but it is not going to be installed

So I' trying to install php7.2-mbstring but error again:

php7.2-mbstring : Depends: php7.2-common (= 7.2.3-1ubuntu1) but 7.2.7-0ubuntu0.18.04.2 is to be installed

Sorry for my bad english. Anyone have idea how to fix this :(

Bùi Ngọc Minh
  • 21
  • 1
  • 1
  • 4
  • So, what about installing the packages in question? What exactly is the problem with that? – Nico Haase Aug 02 '18 at 07:49
  • I ran composer install in laravel project and it showed error: the requested PHP extension mbstring is missing from your system. @NicoHaase – Bùi Ngọc Minh Aug 02 '18 at 08:20
  • On which architecture do you use your system? According to https://packages.ubuntu.com/bionic/php7.2-mbstring, the extension depends on 7.2.7 for amd64 and i386, while other architectures only provide 7.2.3 so far... – Nico Haase Aug 02 '18 at 10:32
  • php 7.2.7 on a clean 18.04 install (apt install php) -- attempting to install mbstring fails with unable-to-locate error. Confirmed that it was listed as a package... if a dependency was missing, you'd get a completely different error... –  Aug 26 '18 at 15:33

2 Answers2

4

Make sure you have the "universe" repository enabled for apt-get:

sudo add-apt-repository "deb http://archive.ubuntu.com/ubuntu $(lsb_release -sc) universe"
Jarad
  • 41
  • 2
3

Edit the file /etc/apt/sources.list with the next lines:

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

Save and run:

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

And it's done

Source: https://askubuntu.com/questions/1064634/unable-to-install-php-mbstring

Dung
  • 19,199
  • 9
  • 59
  • 54