9

I'm running Ubuntu 14.04 on a Digital Ocean VM. I'm trying to install MariaDB 10.1. When doing so, I get the following error:

Setting up mariadb-server-10.1 (10.1.8+maria-1~trusty) ...
dpkg: error processing package mariadb-server-10.1 (--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.1 (= 10.1.8+maria-1~trusty); however:
  Package mariadb-server-10.1 is not configured yet.

dpkg: error processing package mariadb-server (--configure):
 dependency problems - leaving unconfigured
No apport report written because the error message indicates its a followup error from a previous failure.
     Errors were encountered while processing:
 mariadb-server-10.1
 mariadb-server
E: Sub-process /usr/bin/dpkg returned an error code (1)

Here is what I've tried to fix this:

sudo apt-get remove --purge mysql-server mysql-client mysql-common
sudo apt-get autoremove
sudo apt-get autoclean
sudo apt-get install mariadb-server

AND

restarting the machine

I was searching Stack Exchange and other Linux forms for a while and I cannot figure out what is causing this. I appreciate any help that could be offered!

UPDATE: Here is the output of apt-get install -f:

Reading package lists... Done
Building dependency tree
Reading state information... Done
0 upgraded, 0 newly installed, 0 to remove and 0 not upgraded.
2 not fully installed or removed.
After this operation, 0 B of additional disk space will be used.
Setting up mariadb-server-10.1 (10.1.8+maria-1~trusty) ...
dpkg: error processing package mariadb-server-10.1 (--configure):
 subprocess installed post-installation script returned error exit status 1
No apport report written because the error message indicates its a followup error from a previous failure.
                                                                                                          dpkg: dependency problems prevent configuration of mariadb-server:
 mariadb-server depends on mariadb-server-10.1 (= 10.1.8+maria-1~trusty); however:
  Package mariadb-server-10.1 is not configured yet.

dpkg: error processing package mariadb-server (--configure):
 dependency problems - leaving unconfigured
Errors were encountered while processing:
 mariadb-server-10.1
 mariadb-server
E: Sub-process /usr/bin/dpkg returned an error code (1)
Zach Russell
  • 277
  • 1
  • 3
  • 13

5 Answers5

4

Found this in log:

[ERROR] /usr/sbin/mysqld: unknown variable log_slow_queries=/var/log/mysql/mysql-slow.log'

So I commented out conf.d/local.cnf

#log_slow_queries=/var/log/mysql/mysql-slow.log'

And installation finally ends succesfully.

SledgehammerPL
  • 711
  • 9
  • 16
2

Try backing up all files in /var/lib/mysql somewhere. Delete them all and then execute mysql_install_db.

My problem came from removing mysqld and replacing it with mariadb and trying to keep the database files. All other methods failed for me.

1

Your system has problems running the (post)configure script of the mariadb-server-10.1 package.

First, try to clean the apt cache using apt-get clean and to reinstall the package (please note apt-get autoclean only partially clean the cache).

If that fails, you had to use dpkg -i mariadb-server-10.1 and/or dpkg-reconfigure mariadb-server-10.1 to give a more in-depth looking at the specific error.

shodanshok
  • 44,038
  • 6
  • 98
  • 162
1
sudo shutdown -r now

I know it sounds crazy that rebooting the machine solved the problem on linux, but I doublechecked. However I'm working in my Vagrant machine, not sure for Digital Ocean.

System:

  • Debian 7,
  • mysql installed from dotdeb with a working database,
  • updated MariaDB apt sources and key added,
  • install mariadb-server-10.1 which ended with the same error.

After rebooting everything worked, including the DB now served by MariaDB.

MartinS
  • 11
  • 1
0

Refer link below: https://unix.stackexchange.com/questions/249530/mariadb-dependency-problems-leaving-unconfigured

Main> 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
Stuggi
  • 3,366
  • 4
  • 17
  • 34