Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Installing MariaDB - Unmet dependencies, mariadb-server-5.5

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.

like image 323
Courtney Miles Avatar asked Apr 25 '13 12:04

Courtney Miles


1 Answers

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

like image 90
Lloeki Avatar answered Sep 24 '22 11:09

Lloeki