Installing MariaDB - Unmet dependencies, mariadb-server-5.5
Asked Answered
P

8

30

I'm attempting to install MariaDB on Ubuntu 12.04 LTS.

I've followed the instructions provided at https://askubuntu.com/questions/64772/how-to-install-mariadb and from MariaDB.org that appear when you choose the download.

The last step is sudo apt-get install mariadb-server which returns:

Reading package lists... Done
Building dependency tree
Reading state information... Done
Some packages could not be installed. This may mean that you have
requested an impossible situation or if you are using the unstable
distribution that some required packages have not yet been created
or been moved out of Incoming.
The following information may help to resolve the situation:

The following packages have unmet dependencies:
 mariadb-server : Depends: mariadb-server-5.5 but it is not going to be installed
E: Unable to correct problems, you have held broken packages.

The dependency issue is an acknowledge issue (https://mariadb.atlassian.net/browse/MDEV-3882) but I believe the broken package prevents me from working around this.

If I try to install libmariadbclient18 I get the following:

Reading package lists... Done
Building dependency tree
Reading state information... Done
Some packages could not be installed. This may mean that you have
requested an impossible situation or if you are using the unstable
distribution that some required packages have not yet been created
or been moved out of Incoming.
The following information may help to resolve the situation:

The following packages have unmet dependencies:
 libmariadbclient18 : Depends: libmysqlclient18 (= 5.5.30-mariadb1~precise) but 5.5.31-0ubuntu0.12.04.1 is to be installed
E: Unable to correct problems, you have held broken packages.

I've tried to correct the broken package using sudo apt-get install -f, but I still can't install mariadb-server or libmariadbclient18.

Pepperandsalt answered 25/4, 2013 at 12:16 Comment(1)
Related: How do I resolve unmet dependencies?Raglan
A
35
sudo apt-get install libmysqlclient18=5.5.30-mariadb1~precise mysql-common=5.5.30-mariadb1~precise
sudo apt-get install mariadb-server

The first one reverts the two mysql libs that were bumped ubuntu side to the older mariadb ones. The second one can then proceed normally.

Packages got removed because something like apt-get dist-upgrade was run. The GUI actually warns you that something's amiss.

To prevent this issue from cropping up again, tell apt to favor the MariaDB repo via pinning by creating a file in /etc/apt/preferences.d:

$ cat /etc/apt/preferences.d/MariaDB.pref
Package: *
Pin: origin <mirror-domain>
Pin-Priority: 1000

Also, be sure to install libmariadbclient-dev if you need to compile anything (like Ruby gems).

Armada answered 26/4, 2013 at 9:4 Comment(5)
Thankyou, this solved it. I only had CLI so couldn't use a GUI.Pepperandsalt
The CLI (apt-get) at some point should have warned too on a apt-get upgrade, with a 'following packages have been kept back' list. aptitude on the other hand I don't know, but sometimes i feel it tries a bit too much to comply with your wishes.Armada
For Ubuntu 13.10 (Saucy Salamander), use sudo apt-get install libmysqlclient18=5.5.33a+maria-1~saucy mysql-common=5.5.33a+maria-1~saucy mariadb-server mariadb-client.Caceres
what is the file extension should I use at /etc/apt/preferences.d?Seaton
Looking at our servers, .pref is used, but I don't know if it really matters.Armada
P
10

I did something similar to @Lloeki

$ sudo apt-get purge libmariadbclient18 mariadb-server mariadb-client-5.5 libmysqlclient18 mysql-common```

Then looked up the candidate to install and reinstalled it:

$ apt-cache policy libmysqlclient18 | grep -i quantal 
Installed: 5.5.30-mariadb1~quantal
*** 5.5.30-mariadb1~quantal 0
    500 http://ftp.osuosl.org/pub/mariadb/repo/5.5/ubuntu/ quantal/main amd64 Packages
$ apt-cache policy mysql-common | grep -i quantal 
Installed: 5.5.30-mariadb1~quantal
*** 5.5.30-mariadb1~quantal 0
    500 http://ftp.osuosl.org/pub/mariadb/repo/5.5/ubuntu/ quantal/main amd64 Packages
$ 
$ sudo apt-get install libmysqlclient18=5.5.30-mariadb1~quantal mysql-common=5.5.30-mariadb1~quantal mariadb-server mariadb-client

...
 * Stopping MariaDB database server mysqld                                                              [ OK ] 
130428 13:19:40 [Note] Plugin 'InnoDB' is disabled.
130428 13:19:40 [Note] Plugin 'FEEDBACK' is disabled.

I got that Plugin Disabled warning but upon restarting mysql with sudo service mysql restart and installing my sql, innodb seemed fine and show create table mytable was showing ENGINE=InnoDB DEFAULT CHARSET=utf8 as expected.

Pericranium answered 28/4, 2013 at 18:7 Comment(1)
I used the same statements to solve the same problem on ubuntu 13.04. Thanks.Urbas
W
4

@yuvilio has it right with:

$ sudo apt-get install libmysqlclient18=5.5.30-mariadb1~quantal mysql-common=5.5.30-mariadb1~quantal mariadb-server mariadb-client

This works in 12.04 , 12.10 and 13.04 (also LinuxMint 14).

Apparently MariaDB is "sensitive" to anywhere the kernel has been updated past something like 3.5.0-25 which seems to affect the installation of MariaDB using a plain vanilla "sudo apt-get install mariadb-server"

@yuvilio mentions that plugins 'InnoDB' and 'FEEDBACK' are disabled but that InnoDB works after this installation.

This makes perfect sense because MariaDB uses XTRA-DB as a drop in replacement for InnoDB. Presumably MariaDB also has a new feedback module (they want MariaDB feedback to go to mariadb.org and NOT to Oracle/mySQL)

Winy answered 2/5, 2013 at 17:23 Comment(0)
D
4

The answer by @Lloeki doesn't work for me anymore, because the mentioned versions are not available for me, resulting in this error:

E: Version '5.5.30-mariadb1~precise' for 'libmysqlclient18' was not found

To work around this, you need to find a correct version:

You can get a list of available versions with aptitude versions libmysqlclient18. For my system this looked like:

Package libmysqlclient18:
[...]
p   5.5.31+maria-1~precise                                         <NULL>                                      1000
i   1:5.5.32-rel31.0-549.precise                                   <NULL>                                      500
[...]    

(there are several more lines, but only the relevant lines are shown).

The line with i is the currently installed version, and there was no line for the suggested 5.5.30-mariadb1~precise. There was however another candidate that looks promising. Be advised that this, just as I had, doesn't have to be the same for you (changes over time).

In this example you can continue like so:

sudo apt-get install libmysqlclient18=5.5.31+maria-1~precise

and after this the install will select both the client and mariadb-common, and you can continue with:

 sudo apt-get install mariadb-server

without the OP's error.

Danonorwegian answered 10/7, 2013 at 14:25 Comment(0)
Q
2

Try

sudo dpkg --remove --force-remove-reinstreq BROKEN_PACKAGE
Quaky answered 25/4, 2013 at 13:4 Comment(5)
I've tried that, replacing BROKEN_PACKAGE with libmysqlclient18, but it says it's not installed. How do I identify what the broken package is?Pepperandsalt
Try "dpkg --get-selections | less" and go through and write down any mysql package, uninstall them all and try again.Quaky
Thanks. I grepped for maria, mysql, sql, db but found nothing. I would like to know how to fix this, but unfortunately it will be quicker to just blow away the server and start again.Pepperandsalt
Good point, succeeded with: sudo dpkg --ignore-depends=libmariadbclient18 --ignore-depends=php5-mysql --ignore-depends=libqt4-sql-mysql --remove --force-remove-reinstreq libmysqlclient18 AND sudo dpkg --ignore-depends=libmariadbclient18 --ignore-depends=php5-mysql --ignore-depends=libqt4-sql-mysql --purge --force-remove-reinstreq libmysqlclient18Animus
Thanks mate, this is works for me, actually it's need to remove the broken package first and then reinstalling again by using sudo apt-get install mariadb-serverSecure
P
2

I don't know if this helps anyone, but I had trouble installing mariadb 10 and got an error that led me to this page, but nothing I tried helped.

I finally realized that my /tmp dir was owned by root and other users could not write to it. I fixed that issue and then did:

apt-get remove mariadb-server

to try to install it again, but the removal failed, so I removed /var/lib/mysql and then tried:

apt-get remove mariadb-server

again and it actually INSTALLED mariadb-server and got it up and running...

It works now.

Pouf answered 2/4, 2014 at 20:48 Comment(0)
E
2

Let me share with how I solved in my case (Ubuntu 14.04).

I had error:

$ sudo apt-get install mariadb-server-5.5
Reading package lists... Done
Building dependency tree       
Reading state information... Done
Some packages could not be installed. This may mean that you have
requested an impossible situation or if you are using the unstable
distribution that some required packages have not yet been created
or been moved out of Incoming.
The following information may help to resolve the situation:

The following packages have unmet dependencies:
 mariadb-server-5.5 : Depends: mariadb-client-5.5 (>= 5.5.41+maria-1~trusty) but it is not going to be installed
                      Depends: mariadb-server-core-5.5 (>= 5.5.41+maria-1~trusty) but it is not going to be installed
E: Unable to correct problems, you have held broken packages.

Solution:

Step 1: sudo apt-get install libmysqlclient18

Step 2: sudo apt-get install mariadb-server

Notes:

  • I was installing according to these instructions
  • I didn't have previously installed MySQL
Epicycloid answered 22/1, 2015 at 7:16 Comment(1)
This did not work for me. I installed the first, but the second call still fails. Ubuntu 14.04.Inspan
D
0

I was able to get mariadb installed by removing all of the mysql packages then running:


    sudo apt-get install mariadb-server-5.5 mariadb-client-5.5 \
    mariadb-server-core-5.5 mariadb-common mariadb-server \
    libmariadbclient18 libdbd-mysql-perl mariadb-client-core-5.5 \
    libmysqlclient18=5.5.30-mariadb1~quantal \
    mysql-common=5.5.30-mariadb1~quantal

I am not sure if removing mysql first was necessary.

Doradorado answered 26/4, 2013 at 4:20 Comment(2)
Are you the question-poster? If so, you should link-up your accounts.Copyright
Unfortunately I don't have any mysql packages installed to remove :( And your command won't work due to the broken package I can't identify.Pepperandsalt

© 2022 - 2024 — McMap. All rights reserved.