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

时间:2013-04-25 12:16:49

标签: ubuntu apt-get mariadb

我正在尝试在Ubuntu 12.04 LTS上安装MariaDB。

我按照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-server或libmariadbclient18。

8 个答案:

答案 0 :(得分:34)

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

第一个将ubuntu端的两个mysql库恢复为较旧的mariadb。然后第二个可以正常进行。

已删除软件包,因为运行了apt-get dist-upgrade之类的内容。 GUI实际上警告你有些不对劲。

要防止此问题再次出现,请通过在/etc/apt/preferences.d中创建文件来告诉favor the MariaDB repo via pinning

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

另外,如果你需要编译任何东西(比如Ruby gems),请务必安装libmariadbclient-dev

答案 1 :(得分:9)

我做了类似@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.

我得到了插件禁用警告,但在用sudo service mysql restart重新启动mysql并安装我的sql后,innodb看起来很好,而show create table mytable正按预期显示ENGINE=InnoDB DEFAULT CHARSET=utf8

答案 2 :(得分:4)

@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的安装,使用普通的“sudo apt-get install mariadb-server”

@yuvilio提到插件'InnoDB'和'FEEDBACK'已被禁用,但InnoDB在安装后仍可正常工作。

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

答案 3 :(得分:4)

@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的错误。

答案 4 :(得分:2)

尝试

sudo dpkg --remove --force-remove-reinstreq BROKEN_PACKAGE

答案 5 :(得分:2)

我不知道这是否对任何人都有帮助,但我在安装mariadb 10时遇到了麻烦并且出现了导致我访问此页面的错误,但我没有尝试过任何帮助。

我终于意识到我的/ tmp目录由root拥有,其他用户无法写入。我解决了这个问题然后做了:

apt-get remove mariadb-server

尝试再次安装,但删除失败,因此我删除了/var/lib/mysql 然后尝试:

apt-get remove mariadb-server

再次实际上安装了mariadb-server并启动并运行...

现在有效。

答案 6 :(得分:2)

让我分享一下我在案例中的解决方法( 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

备注:

  • 我是根据这些instructions
  • 进行安装的
  • 我之前没有安装MySQL

答案 7 :(得分:0)

我能够通过删除所有运行的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。