天天看點

Ubuntu 13.10 Installing MariaDB

http://askubuntu.com/questions/365992/ubuntu-13-10-installing-mariadb

I have tried everything to install MariaDB on this clean Ubuntu installation but I keep getting this error,

Some packages could not be installed. This may mean that you haverequested an impossible situation or if you are using the unstabledistribution that some required packages have not yet been createdor 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 (= 5.5.33a+maria-1~saucy) but it is not going to be installedE: Unable to correct problems, you have held broken packages.           

I have followed this guide to try and install it, http://www.unixmen.com/install-lemp-server-nginx-mysql-mariadb-php-ubuntu-13-10-server/

And I have also followed the "official" guide on the MariaDB downloads page for 13.10https://downloads.mariadb.org/mariadb/repositories/

But nothing seems to be working.

Edit 1

I have tried both How do I resolve unmet dependencies? and How to install MariaDB? but it still gives me the error I posted above.

It's a fresh Ubuntu install with hardly anything installed.

Edit 2

All the check boxes are ticket in Updates. I ran:

sudo apt-get update && sudo apt-get -f install mariadb-server-5.5"=5.5.33a+maria-1~saucy"           

And it gave me this error:

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

Solution

For future reference read the market solution and for people who are having this problem right now with Ubuntu 13.10 and MariaDB 5.5.33a run this command,

sudo apt-get install mariadb-server-5.5="5.5.33a+maria-1~saucy" mariadb-client 5.5="5.5.33a+maria-1~saucy" \libmysqlclient18="5.5.33a+maria-1~saucy" \mysql-common="5.5.33a+maria-1~saucy"           

Version Mismatch between Mariadb and Ubuntu Debian Repositories

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 installedE: 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':
apt-cache show mysql-common | grep Versionapt-cache show libmysqlclient18 | grep Version           

This is the situation as of this writing, since the version numbers are shown as:

Version: 5.5.34-0ubuntu0.13.10.1Version: 5.5.33a+maria-1~saucy           

The MariaDB page gives two solutions.

First solution: Specifying the package version

For each of the above you will be given a list of versions. The ones in the MariaDB repositories will have "mariadb" in the version strings and are the ones you want. With the version numbers in hand you will be able to install MariaDB by explicitly specifying the version numbers like so:
apt-get install mariadb-server-5.5 mariadb-client-5.5 \libmysqlclient18=<version-number> \mysql-common=<version-number>           

which is

apt-get install mariadb-server-5.5 mariadb-client-5.5 \ libmysqlclient18=5.5.33a+maria-1~saucy \ mysql-common=5.5.33a+maria-1~saucy           

After installation, you need to hold the packages until the version numbers get back in sync.

After MariaDB is installed, and as long as the version number issue exists, an `apt-get dist-upgrade` will try to remove MariaDB in order to install the "upgraded" libmysqlclient and mysql-common packages. To prevent this from happening you can hold them so that apt doesn't try to upgrade them. To do so, open a terminal, become root with `sudo -s`, and then enter the following:

echo libmysqlclient18 hold | dpkg --set-selections

echo mysql-common hold | dpkg --set-selections

The holds will prevent you from upgrading MariaDB, so when you want to remove the holds, open a terminal, become root with 'sudo -s', and then enter the following:

echo libmysqlclient18 install | dpkg --set-selections

echo mysql-common install | dpkg --set-selections

You will then be able to upgrade MariaDB as normal (e.g. with `sudo apt-get update; sudo apt-get upgrade`).

How do I know when the version numbers match again?

You can track the MariaDB version number by signing up for an email alert of new releases atMariaDB.org. According to the site, it is a

low-traffic announce-only list

.

Second solution: Pinning the MariaDB Repository

Another thing you can do is to pin the MariaDB repository that you use. This is done by creating a file under `/etc/apt/preferences.d/` with the following contents:
Package: *Pin: origin <mirror-domain>Pin-Priority: 1000