这个错误怎么办?在 Debian 9 上使用 Plesk 将 MariaDB 10.1 升级到 10.2
有什么线索可以修复它并继续升级吗?
apt install mariadb-server-10.2
Reading package lists... Done
Building dependency tree
Reading state information... Done
The following additional packages will be installed:
libmariadb3 libmariadbclient18 mariadb-client-10.2 mariadb-client-core-10.2 mariadb-server-core-10.2
Suggested packages:
mariadb-test netcat-openbsd tinyca
Recommended packages:
libhtml-template-perl
The following packages will be REMOVED:
default-mysql-server mariadb-client-10.1 mariadb-client-core-10.1 mariadb-server-10.1 mariadb-server-core-10.1
The following NEW packages will be installed:
libmariadb3 mariadb-client-10.2 mariadb-client-core-10.2 mariadb-server-10.2 mariadb-server-core-10.2
The following packages will be upgraded:
libmariadbclient18
1 upgraded, 5 newly installed, 5 to remove and 10 not upgraded.
Need to get 0 B/11.8 MB of archives.
After this operation, 46.1 MB disk space will be freed.
Do you want to continue? [Y/n] y
Preconfiguring packages ...
(Reading database ... 97530 files and directories currently installed.)
Removing default-mysql-server (1.0.2) ...
dpkg: mariadb-server-10.1: dependency problems, but removing anyway as you requested:
plesk-mysql-server depends on virtual-mysql-server | mysql-server; however:
Package virtual-mysql-server is not installed.
Package mariadb-server-10.1 which provides virtual-mysql-server is to be removed.
Package mysql-server is not installed.
plesk-mysql-server depends on virtual-mysql-server | mysql-server; however:
Package virtual-mysql-server is not installed.
Package mariadb-server-10.1 which provides virtual-mysql-server is to be removed.
Package mysql-server is not installed.
plesk-mysql-server depends on virtual-mysql-server | mysql-server; however:
Package virtual-mysql-server is not installed.
Package mariadb-server-10.1 which provides virtual-mysql-server is to be removed.
Package mysql-server is not installed.
plesk-mysql-server depends on virtual-mysql-server | mysql-server; however:
Package virtual-mysql-server is not installed.
Package mariadb-server-10.1 which provides virtual-mysql-server is to be removed.
Package mysql-server is not installed.
Removing mariadb-server-10.1 (10.1.47-0+deb9u1) ...
(Reading database ... 97403 files and directories currently installed.)
Preparing to unpack .../mariadb-server-10.2_10.2.36+maria~stretch_amd64.deb ...
/var/lib/mysql: found previous version 10.1
Unpacking mariadb-server-10.2 (10.2.36+maria~stretch) ...
dpkg: error processing archive /var/cache/apt/archives/mariadb-server-10.2_10.2.36+maria~stretch_amd64.deb (--unpack):
trying to overwrite '/usr/bin/mysql_install_db', which is also in package mariadb-server-core-10.1 10.1.47-0+deb9u1
dpkg-deb: error: subprocess paste was killed by signal (Broken pipe)
Errors were encountered while processing:
/var/cache/apt/archives/mariadb-server-10.2_10.2.36+maria~stretch_amd64.deb
E: Sub-process /usr/bin/dpkg returned an error code (1)
答案1
您使用来自 mariadb.org 存储库的 mariadb-10.2 升级了来自 Debian Stretch 存储库的 mariadb-10.1。一个问题似乎是,需要virtual-mysql-server
安装的 plesk 软件包被来自 Debian Stretch 存储库的 mariadb-10.1 软件包拉入,但被来自 mariadb.org 存储库的软件包拉入。这已经表明升级可能不是一个好主意。
导致安装停止的问题是该文件/usr/bin/mysql_install_db
是 mariadb-10.1 中软件包的一部分,但也是mariadb-10.2 中软件包的mariadb-server-core
一部分。由于软件包先升级,该文件仍然存在并归另一个软件包所有。mariadb-server
mariadb-server
如果您在升级到 mariadb-10.2 之前删除该软件包(以及其所有依赖项),则安装很可能会成功。mariadb-server-core-10.1
但这仍会给您带来 plesk 依赖性问题。