Tuesday, February 3, 2015

MariaDB Installation Error: The following packages have unmet dependencies

You might encounter the following error while trying to install MariaDB on Ubuntu:
> 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.

It's said here Version Mismatch Between MariaDB and Ubuntu/Debian Repositories that:
It is rare for the version numbers of mysql-common or libmysqlclient to be higher in the official Ubuntu or Debian repositories than they are in the MariaDB repositories, but it has happened. Whenever it has it has been because of critical bug fix releases for bugs that existed in the version of MySQL in the distribution repositories but which had already been fixed in the version of MariaDB in the MariaDB repositories.
If a situation as described above exists when you try to install MariaDB you will get an error like this:

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

A way to fix this is to specify the exact version of the two packages that you want to install. To do this, first determine the full version numbers of the affected packages. An easy way to do so is with 'apt-cache show'


You need to do as following:


1. Show version of mysql-common
> apt-cache show mysql-common | grep Version
Version: 5.5.41+maria-1~trusty
Version: 5.5.41-0ubuntu0.14.04.1
Version: 5.5.35+dfsg-1ubuntu1
2. Show version of libmysqlclient18
> apt-cache show libmysqlclient18 | grep Version
Version: 5.5.41+maria-1~trusty
Version: 5.5.41-0ubuntu0.14.04.1
Version: 5.5.35+dfsg-1ubuntu1
3. Install MariaDB
sudo apt-get install mariadb-server-5.5 mariadb-client-5.5 \
> libmysqlclient18=5.5.41+maria-1~trusty \
> mysql-common=5.5.41+maria-1~trusty



No comments:

Post a Comment