3

I am trying to install PHP mbstring module in my Ubuntu 14.04 machine. I've used "sudo apt-get -f install php7.0-mbstring" to install the module. I've added necessary source list in "/etc/apt/sources.list".

When I run the above mbstring installation command I get the following error.

The following packages have unmet dependencies: php7.0-mbstring : Depends: php7.0-common (= 7.0.33-0ubuntu0.16.04.6) but 7.0.21-1~ubuntu14.04.1+deb.sury.org+1 is to be installed Conflicts: php7.0-mbstring:i386 but 7.0.33-0ubuntu0.16.04.6 is to be installed php7.0-mbstring:i386 : Depends: php-common:i386 (>= 1:33) but it is not installable Depends: php7.0-common:i386 (= 7.0.33-0ubuntu0.16.04.6) but it is not going to be installed Depends: libc6:i386 (>= 2.4) but it is not going to be installed Conflicts: php7.0-mbstring but 7.0.33-0ubuntu0.16.04.6 is to be installed E: Unmet dependencies. Try 'apt-get -f install' with no packages (or specify a solution).

What is the recommended solution here? Do I need to uninstall PHP 7.0 and reinstall or is there any other low risk solution?

Edit: I've tried to install with sudo apt-get -f install as well. I get the same following error,

php7.0-mbstring:i386 : Depends: php-common:i386 (>= 1:33) but it is not installable Depends: php7.0-common:i386 (= 7.0.33-0ubuntu0.16.04.6) but it is not installed Depends: libc6:i386 (>= 2.4) but it is not installed E: Error, pkgProblemResolver::Resolve generated breaks, this may be caused by held packages. E: Unable to correct dependencies

  • Have you tried as it suggests `sudo apt-get -f install`? (BTW 14.04 was EOL April this year) – Nigel Ren Sep 23 '19 at 06:48
  • @NigelRen, yes I've tried that too. I get this error when I run sudo apt-get -f install. php7.0-mbstring:i386 : Depends: php-common:i386 (>= 1:33) but it is not installable Depends: php7.0-common:i386 (= 7.0.33-0ubuntu0.16.04.6) but it is not installed Depends: libc6:i386 (>= 2.4) but it is not installed E: Error, pkgProblemResolver::Resolve generated breaks, this may be caused by held packages. E: Unable to correct dependencies – Thanga Pandiyan Sep 23 '19 at 06:49
  • As it's complaining about libc6, is it installed (try `sudo apt-get install libc6`) – Nigel Ren Sep 23 '19 at 07:06
  • @NigelRen, thanks for your reply. I've tried to install libc6 as well. This is error I got - php7.0-mbstring:i386 : Depends: php-common:i386 (>= 1:33) but it is not installable Depends: php7.0-common:i386 (= 7.0.33-0ubuntu0.16.04.6) but it is not installed Depends: libc6:i386 (>= 2.4) but it is not installed – Thanga Pandiyan Sep 23 '19 at 08:52
  • @ThangaPandiyan did you manage to find a solution for this issue? I'm currently having the same problem – King Of The Jungle Sep 22 '22 at 13:54

1 Answers1

0

First be sure that your package list is up to date, try:

sudo apt-get update

After it try install packeage again

sudo apt-get install php7.0-mbstring

If it doesn't help try to add php repository to source list, for example you can use this PPA

sudo apt-add-repository ppa:ondrej/php
sudo apt-get update
sudo apt-get install php7.0-mbstring
  • Hello @ashot, thanks for your reply. I've tried your solution too. It didn't work either :(. I've been adding so many source lists from the Internet. I get the same error, which is dependency conflict. – Thanga Pandiyan Sep 23 '19 at 07:31
  • can you change your php version, I'm not sure that it was problem, but may be) – Ashot Hayrapetyan Sep 23 '19 at 08:16