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

Posted December 4, 2019 12.5k views

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:

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

These answers are provided by our Community. If you find them useful, show some love by clicking the heart. If you run into issues leave a comment, or add your own answer to help others.

Submit an Answer
1 answer

Hello, @sergeydgr8

Have you tried adding the following channels in the sources.list:

deb bionic main multiverse restricted universe
deb bionic-security main multiverse restricted universe
deb 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.


  • 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.