安装MariaDB - 未满足的依赖关系,mariadb-server-5.5

问题描述:

我试图在Ubuntu 12.04 LTS上安装MariaDB。安装MariaDB - 未满足的依赖关系,mariadb-server-5.5

我按照https://askubuntu.com/questions/64772/how-to-install-mariadb提供的说明和MariaDB.org提供的说明选择了下载。

的最后一步是sudo apt-get install mariadb-server返回:

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. 

的依赖问题是一个确认的问题(https://mariadb.atlassian.net/browse/MDEV-3882),但我相信,破包不允许我身边这个工作。

如果我尝试安装libmariadbclient18我得到如下:

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. 

我试图纠正使用sudo apt-get install -f的破包,但我仍然无法安装MariaDB的服务器或libmariadbclient18。

+1

相关安装:?如何解决未满足的依赖(http://askubuntu.com/questions/140246/how-do-i-resolve-unmet-dependencies) – 2013-07-12 00:23:08

sudo apt-get install libmysqlclient18=5.5.30-mariadb1~precise mysql-common=5.5.30-mariadb1~precise 
sudo apt-get install mariadb-server 

第一个恢复两个被碰撞到Ubuntu旧版本的mariadb的mysql库。第二个可以正常进行。

包被删除,因为类似apt-get dist-upgrade运行。 GUI实际上警告你有什么不对劲。

为了防止再次突然出现这个问题,告诉易favor the MariaDB repo via pinning/etc/apt/preferences.d创建一个文件:

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

此外,一定要安装libmariadbclient-dev如果你需要编译任何东西(如红宝石宝石)。

+0

Thankyou,这个解决了它。我只有CLI,所以不能使用GUI。 – user2045006 2013-04-26 23:11:46

+0

在某些时候,CLI(apt-get)应该也会在'apt-get upgrade'上发出警告,*'下面的软件包已经被保存了'* list。另一方面,aptitude我不知道,但有时候我觉得它有点太符合你的愿望了。 – Lloeki 2013-04-29 08:37:41

+0

对于'Ubuntu 13.10'(Saucy Salamander),使用'sudo apt-get install libmysqlclient18 = 5.5.33a + maria-1〜saucy mysql-common = 5.5.33a + maria-1〜saucy mariadb-server mariadb-client'。 – absynce 2013-10-25 17:30:22

尝试

sudo dpkg --remove --force-remove-reinstreq BROKEN_PACKAGE 
+0

我试过了,用libmysqlclient18替换BROKEN_PACKAGE,但它表示没有安装。我如何识别破损的包装是什么? – user2045006 2013-04-25 20:37:40

+0

尝试“dpkg --get-selections | less”并通过并写下任何mysql包,将其全部卸载并重试。 – dezza 2013-04-25 20:58:05

+1

谢谢。我grepped玛丽亚,MySQL,SQL中,但没有发现什么。我想知道如何解决这个问题,但不幸的是,它会更快地吹走服务器并重新启动。 – user2045006 2013-04-26 07:26:12

我能够通过删除所有mysql的包,然后运行以获得安装MariaDB的:

 

    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 

我不知道,如果去除MySQL的第一个是必要的。

+0

你是问题海报吗?如果是这样,你应该连接你的帐户。 – 2013-04-26 04:38:57

+0

不幸的是,我没有安装任何mysql软件包来删除:(而且你的命令不会工作,因为我无法识别破损的软件包。 – user2045006 2013-04-26 07:24:36

我没有类似的东西,以@Lloeki

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

然后抬头候选安装和重新安装它:

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

我得到的插件禁用警告,但重新启动MySQL w后ith sudo service mysql restart并安装我的SQL,innodb似乎很好,show create table mytable显示ENGINE=InnoDB DEFAULT CHARSET=utf8预期。

+0

我使用了相同的状态在Ubuntu 13.04上解决同样的问题。谢谢。 – 2013-07-11 09:52:41

@yuvilio有它正确搭配:

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

这工作在12.04,12.10和13.04(也LinuxMint 14)。

显然MariaDB的是“敏感”随时随地内核已经更新过去类似3.5.0-25这似乎用一个普通的影响MariaDB的安装“命令和apt-get安装MariaDB的服务器”

@yuvilio提到插件的'InnoDB'和'FEEDBACK'被禁用,但InnoDB在安装完成后工作。

这非常合理,因为MariaDB使用XTRA-DB作为InnoDB的替代品。据推测,MariaDB也有一个新的反馈模块(他们希望MariaDB反馈到mariadb.org而不是Oracle/mySQL)

@Lloeki的回答不再适用于我,因为提到的版本不可用对我来说,造成这种错误:

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

要解决这个问题,你需要找到一个正确的版本:

你可以得到可用版本的列表,aptitude versions libmysqlclient18。对于我的系统,这看起来像:

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

(还有几行,但只显示相关行)。

i一致的行是当前安装的版本,建议的5.5.30-mariadb1~precise没有行。然而,另一位候选人看起来很有希望。请注意,这一点,就像我一样,对于你来说不一定是一样的(随时间变化)。

在这个例子中,你可以继续像这样:

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

,并在此之后,安装将选择在客户端mariadb-common,你可以继续:

sudo apt-get install mariadb-server 

无OP的错误。

我不知道这是否有助于任何人,但我安装mariadb 10时遇到了问题,并且遇到了导致我进入此页面的错误,但没有任何我试过的帮助。

我终于意识到我的/ tmp dir属于root,其他用户无法写入。我固定的问题,然后做:

apt-get remove mariadb-server 

尝试重新安装,但删除失败,所以我删除/var/lib/mysql ,然后尝试:再次

apt-get remove mariadb-server 

,它实际安装mariadb-服务器,并得到它并运行...

它现在的作品。

让我分享我的解决方案(Ubuntu 14.04)。

我不得不错误

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

解决方案:

步骤1:sudo apt-get install libmysqlclient18

步骤2:sudo apt-get install mariadb-server

注:

+0

这不适合我。我安装了第一个,但第二个调用仍然失败。 Ubuntu 14.04。 – Deleet 2016-09-22 03:01:20