The MariaDB Blog The Official Blog of the MariaDB Project

Tag Archives: “MySQL 5.5″

Dotdeb is a repository currently targeting Debian and Ubuntu, providing a nice set of packages for LAMP servers.

Recently, MySQL 5.6 was added to the dotdeb repository. On the surface, this is a very harmless addition. MariaDB is a replacement for MySQL and it should be possible for applications designed for MySQL to easily switch to MariaDB. Therefore MariaDB also includes the libraries that applications using MySQL depend upon, such as libmysqlclient18 and mysql-common. The dpkg package manager looks at the MySQL 5.6 packages in dotdeb and assumes that 5.6 is a higher version than 5.5, which results in it removing or replacing libraries during normal apt-get installation and upgrade procedures.

The problems appear in the following scenarios:

apt-get install mariadb-server-5.5 (fresh or over a previous version)

apt-get upgrade (if MariaDB 5.5 is installed)

apt-get dist-upgrade (if MariaDB 5.5 is installed)

Scenario 3, dist-upgrade, is especially nasty because in its attempt to upgrade the libmysqlclient18 and mysql-common packages, dpkg will REMOVE MariaDB.

MySQL 5.5 users are also affected in a similar way although the consequences look to be a bit lighter. Our early tests show for example that dist-upgrade will upgrade MySQL 5.5 to MySQL 5.6, which might come as a surprise. MySQL 5.5 users should therefore double-check how they are affected.

See below for examples of what these problems look like in practice. It is also worth noting that the problems do NOT exist if you are using MariaDB 10.0. With MariaDB 10.0 all the listed scenarios work just fine. MariaDB 10.0 is GA now and therefore a good alternative.

Solution

Fortunately there is a workaround that can be used and has been proven to work. By pinning the MariaDB repository you can override the normal behavior (where the highest version number wins). The process is simple. You only need to add a preferences file (with a .pref extension) for the MariaDB repository under the /etc/apt/preferences.d/ directory. The contents should look similar to the following:

1

2

3

4

$ cat /etc/apt/preferences.d/mariadb.pref

Package: *

Pin: origin ftp.osuosl.org

Pin-Priority: 1000

The value of Pin-Priority must be at least 1000. Also note that the Pin: row needs to have the domain name of the repository that you are using for your MariaDB apt sources file entry. In this example the domain is ftp.osuosl.org.

With the preference file in place the packages in the MariaDB repository will be preferred over the similarly named packages in the dotdeb repository and the problematic scenarios listed above will work just fine.

Many thanks to our users who promptly reported the problem on IRC, helped to find the root cause and experimented with the workaround!

Examples of the problematic scenarios

Scenario 1: Fresh installation or installation over a previous version of MariaDB 5.5
Result: Fails

1

2

3

4

5

6

7

8

9

10

11

12

13

$ sudo apt-get install mariadb-server mariadb-client

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-client : Depends: mariadb-client-5.5 (= 5.5.36+maria-1~wheezy) but it is not going to be installed

mariadb-server : Depends: mariadb-server-5.5 (= 5.5.36+maria-1~wheezy) but it is not going to be installed