当 mysql 妨碍时如何安装 mariadb?

当 mysql 妨碍时如何安装 mariadb?

我在 Google 上搜索了一段时间,但对于我在 VM 上遇到的这种奇怪情况,似乎没有什么明显的发现,有人可以帮帮我吗?

root@sathia:/etc/apt# apt-cache policy mariadb-server
mariadb-server:
  Installed: 10.0.20+maria-1~jessie
  Candidate: 10.0.20+maria-1~jessie
  Version table:
 *** 10.0.20+maria-1~jessie 0
       1000 http://ftp.osuosl.org/pub/mariadb/repo/10.0/debian/ jessie/main amd64 Packages
        100 /var/lib/dpkg/status
     10.0.16-1 0
        500 http://httpredir.debian.org/debian/ jessie/main amd64 Packages
root@sathia:/etc/apt# apt-get install mariadb-server
Reading package lists... Done
Building dependency tree
Reading state information... Done
mariadb-server is already the newest version.
You might want to run 'apt-get -f install' to correct these:
The following packages have unmet dependencies:
 mariadb-client : Depends: mariadb-client-10.0 (= 10.0.20+maria-1~jessie) but 10.0.16-1 is to be installed
 mariadb-server : Depends: mariadb-server-10.0 (= 10.0.20+maria-1~jessie) but it is not going to be installed
E: Unmet dependencies. Try 'apt-get -f install' with no packages (or specify a solution).
root@sathia:/etc/apt# apt-get -f install
Reading package lists... Done
Building dependency tree
Reading state information... Done
Correcting dependencies... Done
The following extra packages will be installed:
  mariadb-client-10.0 mariadb-client-core-10.0 mariadb-server-10.0
Suggested packages:
  tinyca mariadb-test
The following NEW packages will be installed:
  mariadb-server-10.0
The following packages will be upgraded:
  mariadb-client-10.0 mariadb-client-core-10.0
2 upgraded, 1 newly installed, 0 to remove and 9 not upgraded.
6 not fully installed or removed.
Need to get 0 B/7,669 kB of archives.
After this operation, 77.1 MB of additional disk space will be used.
Do you want to continue? [Y/n] Y
Reading changelogs... Done
Preconfiguring packages ...
dpkg: regarding .../mariadb-client-core-10.0_10.0.20+maria-1~jessie_amd64.deb containing mariadb-client-core-10.0:
 mariadb-client-10.0 conflicts with mysql-client-core-5.5
  mariadb-client-core-10.0 provides mysql-client-core-5.5 and is to be installed.

dpkg: error processing archive /var/cache/apt/archives/mariadb-client-core-10.0_10.0.20+maria-1~jessie_amd64.deb (--unpack):
 conflicting packages - not installing mariadb-client-core-10.0
dpkg: regarding .../mariadb-client-10.0_10.0.20+maria-1~jessie_amd64.deb containing mariadb-client-10.0:
 mariadb-client-core-10.0 conflicts with mysql-client-5.5
  mariadb-client-10.0 provides mysql-client-5.5 and is to be installed.

dpkg: error processing archive /var/cache/apt/archives/mariadb-client-10.0_10.0.20+maria-1~jessie_amd64.deb (--unpack):
 conflicting packages - not installing mariadb-client-10.0
(Reading database ... 45005 files and directories currently installed.)
Preparing to unpack .../mariadb-server-10.0_10.0.20+maria-1~jessie_amd64.deb ...
Unpacking mariadb-server-10.0 (10.0.20+maria-1~jessie) ...
dpkg: error processing archive /var/cache/apt/archives/mariadb-server-10.0_10.0.20+maria-1~jessie_amd64.deb (--unpack):
 trying to overwrite '/usr/share/man/man1/innochecksum.1.gz', which is also in package mariadb-client-10.0 10.0.16-1
dpkg-deb: error: subprocess paste was killed by signal (Broken pipe)
Processing triggers for systemd (215-17+deb8u1) ...
Processing triggers for man-db (2.7.0.2-5) ...
Errors were encountered while processing:
 /var/cache/apt/archives/mariadb-client-core-10.0_10.0.20+maria-1~jessie_amd64.deb
 /var/cache/apt/archives/mariadb-client-10.0_10.0.20+maria-1~jessie_amd64.deb
 /var/cache/apt/archives/mariadb-server-10.0_10.0.20+maria-1~jessie_amd64.deb
E: Sub-process /usr/bin/dpkg returned an error code (1)

答案1

看来您已经安装了比存储库中可用的版本更新的 MariaDB 版本。您有 10.0.20,而存储库有 10.0.16-1。关于 MySQL 的通知是由于提供mariadb-client兼容性mysql-client包。

如果您确实想要从 repo 安装,则需要先卸载现有安装,然后从 repo 安装。

相关内容