MariaDB - dependency problems - leaving unconfigured

Try the following:

apt-get remove --purge mysql*
apt-get remove --purge mysql
apt-get remove --purge mariadb
apt-get remove --purge mariadb*
apt-get --purge remove mariadb-server
apt-get --purge remove python-software-properties

Note: When prompted if you want to dump your current Databases, say no. But you can deconfigure the phpmyadmin database easily.

Install everything from fresh: Add the following to your /etc/apt/sources.list file:

deb [arch=amd64,i386] http://ftp.utexas.edu/mariadb/repo/10.1/debian jessie main
deb-src http://ftp.utexas.edu/mariadb/repo/10.1/debian jessie main

Then,

apt-get install python-software-properties
apt-key adv --recv-keys --keyserver keyserver.ubuntu.com 0xcbcb082a1bb943db
apt-get install software-properties-common
apt-get install mariadb-server mariadb-client

Once your are done you should be able to run mysql -V and see something like:

mysql  Ver 15.1 Distrib 10.1.9-MariaDB, for debian-linux-gnu (x86_64) using readline 5.2

I just got this error. For those new here.

The problem was from mysql database missing. Because I deleted the folders /var/lib/mysql/ and /etc/mysql/.

I just executed sudo mysql_install_db. Then start the MySql service sudo service mysql start. It should work.

If you get error when executed sudo mysql_install_db, execute sudo mkdir /etc/mysql/conf.d/. Then start again.


I had a very similar issue installing MariaDB server 10.0 on Ubuntu 16.04 upgraded from Ubuntu 14.04.

Setting up mariadb-server-10.0 (10.0.31-0ubuntu0.16.04.2) ...
dpkg: error processing package mariadb-server-10.0 (--configure):
 subprocess installed post-installation script returned error exit status 1
dpkg: dependency problems prevent configuration of mariadb-server:
 mariadb-server depends on mariadb-server-10.0 (>= 10.0.31-0ubuntu0.16.04.2); however:
  Package mariadb-server-10.0 is not configured yet.

dpkg: error processing package mariadb-server (--configure):
 dependency problems - leaving unconfigured

@user3502626's answer gave a hint using sudo mysql_install_db, which provided a new error:

/usr/sbin/mysqld: Can't read dir of '/etc/mysql/mariadb.conf.d/' (Errcode: 13 "Permission denied")

Searching for that error led to a Debian bug report that pointed the problem at AppArmor, and could be solved with:

$ echo -n "/usr/sbin/mysqld" | sudo tee /sys/kernel/security/apparmor/.remove
$ apt install -f
$ apparmor_parser -r /etc/apparmor.d/usr.sbin.mysqld

That installed MariaDB properly.