How do I install php7.2-mbstring? (Ubuntu 14.04)

December 4, 2019 95 views
PHP Ubuntu

I’m currently running Ubuntu 14.04 on a several year-old droplet. I’ve updated my repos and sources, made sure universe and multiverse are enabled, and yet I’m still having trouble getting mbstring installed on this droplet.

I’ve tried installing php-mbstring, php7.0-mbstring, php7.2-mbstring, and it still turns up with the same error:

Reading package lists... Done
Building dependency tree
Reading state information... Done
E: Unable to locate package php7.2-mbstring
E: Couldn't find any package by regex 'php7.2-mbstring'

I’ve tried to find all the resources I can to remedy this. I’ve followed these:
https://askubuntu.com/questions/1048389/package-php7-2-mbstring-missing-in-ubuntu-18-04
https://www.digitalocean.com/community/questions/e-unable-to-locate-package-php-mbstring

with no progress. I noticed there are a few digitalocean.com mirrors in my repo list, could they be in conflict with official Ubuntu archives?

1 Answer

Hello, @sergeydgr8

Have you tried adding the following channels in the 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

Just open /etc/apt/sources.list in your favorite text editor and add the above lines and then run:

sudo apt install php7.2-mbstring

You can also make sure evetyhing else is up to date by running:

sudo apt-get update

Let me know how it goes.

Regards,
Alex

  • I think I sort of see what’s going on…

    Ubuntu axed support for Trusty in April ‘19, and it seems like I need to update my sources. Will updating to new source (despite using an older OS) have any adverse effects?

    • Hello, @sergeydgr8

      Generally everything should be fine after the update, but if you wish you can create a backup before doing the update. Keep in mind that is always recommended to keep your software up to date, unless your site/app relies on a specific version.

      Regards,
      Alex

Have another answer? Share your knowledge.