首页 文章

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

提问于
浏览
27

我正在尝试在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
    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 中创建文件告诉apt到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 .

  • 2

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

    @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)

  • 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的错误 .

  • 34

    尝试

    sudo dpkg --remove --force-remove-reinstreq BROKEN_PACKAGE
    
  • 2

    让我分享一下我在案件中的解决方法( Ubuntu 14.04 ) .

    我有 error

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

    Solution:

    第1步: sudo apt-get install libmysqlclient18

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

    Notes:

    • 我正按照这些安装instructions

    • 我以前没有安装MySQL

  • 9

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

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

    apt-get remove mariadb-server
    

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

    apt-get remove mariadb-server
    

    再次,它实际上安装了mariadb服务器并启动并运行...

    它现在有效 .

  • 4

    通过删除所有运行的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 .

相关问题