MariaDB Installation Problems with Ubuntu 16.04 running on OpenVZ

I run MariaDB 10 on my builds and so far haven’t experienced any issues…until today.  I have a VPS running on OpenVZ and recently upgraded it to Ubuntu 16.04 LTS.  After trying to install MariaDB I noticed the following errors when it tried to start:

After some digging, it turns out the OpenVZ template that my VPS uses installs a few mysql common components which were conflicting with MariaDB.  Do a quick check to see if you have any mysql components installed:

If so, you need to remove them.  Run the following command to remove any instances of mysql and mariadb

Then reboot and run an update

Now you can reinstall MariaDB

Check its status

And once everything’s working, it’s a good idea to apply the mysql secure configuration package

I hope this helps somebody.  There isn’t much information on this problem as I think many of the VPS providers (as was the case with mine) are just now getting up to date with Ubuntu 16.04 and getting their templates worked out.