0

When I try to install php7-mbstring I get the following error:

The following packages have unmet dependencies:
php7.0-mbstring : Depends: php7.0-common (= 7.0.8-0ubuntu0.16.04.3)
but 7.0.13-0ubuntu0.16.04.1 is to be installed
E: Unable to correct problems, you have held broken packages.

I tried what is advice here: How do I resolve unmet dependencies after adding a PPA?. But it did'n work... Any advice ?

Thanks !

Yo Deux
  • 1
  • 2
  • Try `sudo apt install php7.0-common php7.0-mbstring` – George Udosen Jan 03 '17 at 11:20
  • Same problem... I think my system is not getting the right version of mbstring. But the package for 7.0.13 exists here : https://launchpad.net/ubuntu/xenial/armhf/php7.0-mbstring/7.0.13-0ubuntu0.16.04.1 – Yo Deux Jan 03 '17 at 11:23
  • How did you install `php 7`, do you remember ? – George Udosen Jan 03 '17 at 11:24
  • apt-get install php7.0-common – Yo Deux Jan 03 '17 at 11:25
  • Did you do `sudo apt -f install` or you did `sudo apt-get -f install` ? – George Udosen Jan 03 '17 at 11:25
  • Yes I tried all of these already. Also removed and reinstall php7 – Yo Deux Jan 03 '17 at 11:26
  • Did you install php 7 with `sudo apt install php7.0` ? – George Udosen Jan 03 '17 at 11:27
  • what version of `php` are you using ? – George Udosen Jan 03 '17 at 11:28
  • I use php 7.0.13 – Yo Deux Jan 03 '17 at 11:37
  • If I understood you correctly, you installed PHP from an external/third-party repository. Note that the PHP repository has now been added to Ubuntu 16.04 so you need not add a repository in order to install it. Try to uninstall and remove the PPA you added then install using: `sudo apt-get install php` . Hope that helps :) http://askubuntu.com/a/705893/476968 – Tshilidzi Mudau Jan 03 '17 at 11:57
  • I finally managed to fix the problem. My source.list did not have XENIAL PROPOSED enabled, and the mbstring package for php 7.0.13 was on this repo. I added it to sources.list and then ran apt-get update && apt-get upgrade and it worked like a charm :) Thanks all for your help – Yo Deux Jan 03 '17 at 12:44

1 Answers1

0

Finally, I managed to resolve the issue by searching for the package on Ubuntu depository.

The php7.0-mbstring for php 7.0.13 was on the proposed repository that wasn't in my source list

So I edited my sources.list in /etc/apt/sources.list by adding

deb http://archive.ubuntu.com/ubuntu/ xenial-proposed restricted main multiverse universe

then run apt-get update and then apt-get install php7.0-mbstring

Worked fine !

Yo Deux
  • 1
  • 2