我正在尝试在装有 Ubuntu 14.10 的笔记本电脑上安装 MariaDB。每次我都会收到错误。所以,问题是 MariaDB 需要 libmysqlclient18 版本 10.0.16,但安装了 5.xx。如果我安装 10.0.16,我会收到新的错误,提示另一个应用程序需要 libmysqlclient18 以前的版本。我尝试执行MariaDB 安装指南页面,但没用。或者我做错了什么。
ant@ubuntupc:~$ sudo apt-get install mariadb-server
Reading package lists... Done
Building dependency tree
Reading state information... Done
You might want to run 'apt-get -f install' to correct these:
The following packages have unmet dependencies:
libmariadbclient18 : Depends: libmysqlclient18 (= 10.0.16+maria-1~utopic) but 5.5.41-0ubuntu0.14.10.1 is to be installed
E: Unmet dependencies. Try 'apt-get -f install' with no packages (or specify a solution).
ant@ubuntupc:~$ sudo apt-get install libmysqlclient18=10.0.16+maria-1~utopic
Reading package lists... Done
Building dependency tree
Reading state information... Done
The following packages were automatically installed and are no longer required:
aptitude-common aptitude-doc-en cabextract intltool libaio1 libcwidget3
libdbd-mysql-perl libdbi-perl libunique-3.0-0 libxml-parser-perl
linux-headers-3.16.0-23 linux-headers-3.16.0-23-generic
linux-image-3.16.0-23-generic linux-image-extra-3.16.0-23-generic
mariadb-client-10.0 mariadb-client-core-10.0 mariadb-server-10.0
mariadb-server-core-10.0
Use 'apt-get autoremove' to remove them.
The following packages will be upgraded:
libmysqlclient18
1 upgraded, 0 newly installed, 0 to remove and 38 not upgraded.
5 not fully installed or removed.
Need to get 0 B/2 948 B of archives.
After this operation, 3 478 kB disk space will be freed.
dpkg: error processing archive /var/cache/apt/archives/libmysqlclient18_10.0.16+maria-1~utopic_amd64.deb (--unpack):
libmysqlclient18:amd64 10.0.16+maria-1~utopic (Multi-Arch: no) is not co-installable with libmysqlclient18 which has multiple installed instances
Errors were encountered while processing:
/var/cache/apt/archives/libmysqlclient18_10.0.16+maria-1~utopic_amd64.deb
E: Sub-process /usr/bin/dpkg returned an error code (1)
ant@ubuntupc:~$ sudo apt-get -f install
Reading package lists... Done
Building dependency tree
Reading state information... Done
Correcting dependencies... Done
The following packages were automatically installed and are no longer required:
aptitude-common aptitude-doc-en cabextract intltool libaio1 libcwidget3
libdbd-mysql-perl libdbi-perl libunique-3.0-0 libxml-parser-perl
linux-headers-3.16.0-23 linux-headers-3.16.0-23-generic
linux-image-3.16.0-23-generic linux-image-extra-3.16.0-23-generic
mariadb-client-10.0 mariadb-client-core-10.0 mariadb-server-10.0
mariadb-server-core-10.0
Use 'apt-get autoremove' to remove them.
The following extra packages will be installed:
libmysqlclient18
The following packages will be upgraded:
libmysqlclient18
1 upgraded, 0 newly installed, 0 to remove and 38 not upgraded.
5 not fully installed or removed.
Need to get 0 B/2 948 B of archives.
After this operation, 3 478 kB disk space will be freed.
Do you want to continue? [Д/н] y
dpkg: error processing archive /var/cache/apt/archives/libmysqlclient18_10.0.16+maria-1~utopic_amd64.deb (--unpack):
libmysqlclient18:amd64 10.0.16+maria-1~utopic (Multi-Arch: no) is not co-installable with libmysqlclient18 which has multiple installed instances
Errors were encountered while processing:
/var/cache/apt/archives/libmysqlclient18_10.0.16+maria-1~utopic_amd64.deb
E: Sub-process /usr/bin/dpkg returned an error code (1)
ant@ubuntupc:~$
答案1
似乎您有来自另一个应用程序使用的 mysql-client 库的工件。我建议这样做
sudo aptitude search libmysql | grep '^i'
这将显示已安装的 libmysql 版本,您可以尝试使用 apt 逐个删除这些版本。您安装的某个应用程序可能依赖于所述版本,并在此过程中强制删除自身。
答案2
看来我找到了解决方案。我像典型的 Windows 用户一样修复了它 :-) 只需删除所有 mysql 和 mariadb 包并安装 mariadb。
答案3
首先,彻底摆脱两个冲突的客户端:
sudo apt-get –purge remove libmariadbclient1
sudo apt-get –purge remove libmysqlclient18
然后再次尝试安装 mariadb。现在应该可以正常工作了。
sudo apt-get update
sudo apt-get install mariadb-server-10.1
最后,
sudo apt-get upgrade
确保一切恢复正常。
取自 http://mikelfox.com/mysql/problems-installing-mariadb-5-5-10-1-on-ubuntu-12-13-14-04-etc/