2
votes

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

1
Have you tried as it suggests sudo apt-get -f install? (BTW 14.04 was EOL April this year) - Nigel Ren
@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
As it's complaining about libc6, is it installed (try sudo apt-get install libc6) - Nigel Ren
@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

1 Answers

0
votes

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