![Ubuntu 12.04.4 LTS 上的 MariaDB Galera 尝试覆盖 /usr/bin/mysqld](https://linux22.com/image/1401177/Ubuntu%2012.04.4%20LTS%20%E4%B8%8A%E7%9A%84%20MariaDB%20Galera%20%E5%B0%9D%E8%AF%95%E8%A6%86%E7%9B%96%20%2Fusr%2Fbin%2Fmysqld.png)
今天早上我注意到 MariaDB 有一个可用的更新,从 5.5.35 到 5.5.36。所以我决定升级 MariaDB 集群中的三个节点之一。但是更新失败了:
root@${hostname}:~# apt-get install -y mariadb-galera-server
Reading package lists...
Building dependency tree...
Reading state information...
The following extra packages will be installed:
mariadb-galera-server-5.5 mariadb-server-core-5.5
Suggested packages:
tinyca mariadb-test
Recommended packages:
libhtml-template-perl
The following NEW packages will be installed:
mariadb-server-core-5.5
The following packages will be upgraded:
mariadb-galera-server mariadb-galera-server-5.5
2 upgraded, 1 newly installed, 0 to remove and 3 not upgraded.
Need to get 29.4 MB of archives.
After this operation, 16.0 MB of additional disk space will be used.
Get:1 http://${ubuntu_mirror_here}/pub/MariaDB/repo/5.5/ubuntu/ precise/main mariadb-galera-server all 5.5.36+maria-1~precise [2994 B]
Get:2 http://${ubuntu_mirror_here}/pub/MariaDB/repo/5.5/ubuntu/ precise/main mariadb-galera-server-5.5 amd64 5.5.36+maria-1~precise [24.0 MB]
Get:3 http://${ubuntu_mirror_here}/pub/MariaDB/repo/5.5/ubuntu/ precise/main mariadb-server-core-5.5 amd64 5.5.36+maria-1~precise [5366 kB]
Fetched 29.4 MB in 3s (8357 kB/s)
(Reading database ... 72891 files and directories currently installed.)
Preparing to replace mariadb-galera-server 5.5.35+maria-1~precise (using .../mariadb-galera-server_5.5.36+maria-1~precise_all.deb) ...
Unpacking replacement mariadb-galera-server ...
Preparing to replace mariadb-galera-server-5.5 5.5.35+maria-1~precise (using .../mariadb-galera-server-5.5_5.5.36+maria-1~precise_amd64.deb) ...
Unpacking replacement mariadb-galera-server-5.5 ...
Selecting previously unselected package mariadb-server-core-5.5.
Unpacking mariadb-server-core-5.5 (from .../mariadb-server-core-5.5_5.5.36+maria-1~precise_amd64.deb) ...
Processing triggers for ureadahead ...
Processing triggers for man-db ...
* Stopping MariaDB database server mysqld
...done.
* Stopping MariaDB database server mysqld
...done.
dpkg: error processing /var/cache/apt/archives/mariadb-server-core-5.5_5.5.36+maria-1~precise_amd64.deb (--unpack):
trying to overwrite '/usr/sbin/mysqld', which is also in package mariadb-galera-server-5.5 5.5.36+maria-1~precise
dpkg-deb: error: subprocess paste was killed by signal (Broken pipe)
Errors were encountered while processing:
/var/cache/apt/archives/mariadb-server-core-5.5_5.5.36+maria-1~precise_amd64.deb
E: Sub-process /usr/bin/dpkg returned an error code (1)
清除然后重新安装软件包仍出现同样的失败。
使用 dpkg -i foo.deb 手动逐个安装 mariadb-server-core-5.5 和 mariadb-galera-server-5.5 都会导致同样的失败,无论我尝试按照何种顺序安装它们。
这些软件包似乎包含两个不同版本的 MySQL 守护程序二进制文件:
root@${hostname}:~# dpkg -c mariadb-server-core-5.5_5.5.36+maria-1~precise_amd64.deb|fgrep /usr/sbin/mysqld
-rwxr-xr-x root/root 14461408 2014-02-24 14:06 ./usr/sbin/mysqld
root@${hostname}:~# dpkg -c mariadb-galera-server-5.5_5.5.36+maria-1~precise_amd64.deb|fgrep /usr/sbin/mysqld
-rwxr-xr-x root/root 14680016 2014-03-10 05:39 ./usr/sbin/mysqld
root@${hostname}:~#
这是否(正如我怀疑的)是一个包装错误?
我有什么办法可以解决这个问题?我应该重新安装以前的版本 5.5.35 吗?
我认为最终会发布没有这个问题的新 MariaDB 软件包。对我来说,测试现有软件包是否仍然存在问题的最佳方法是什么?我能想到的就是每次下载 .debs 并重复上述实验dpkg -c
。
更新:按照建议安装https://mariadb.com/kb/en/mariadb-galera-5529-release-notes/以同样的方式失败:
apt-get install mariadb-galera-server galera
Reading package lists... Done
Building dependency tree
Reading state information... Done
galera is already the newest version.
The following extra packages will be installed:
mariadb-galera-server-5.5 mariadb-server-core-5.5
Suggested packages:
tinyca mariadb-test
Recommended packages:
libhtml-template-perl
The following NEW packages will be installed:
mariadb-galera-server mariadb-galera-server-5.5 mariadb-server-core-5.5
0 upgraded, 3 newly installed, 0 to remove and 3 not upgraded.
Need to get 29.4 MB of archives.
After this operation, 97.6 MB of additional disk space will be used.
Do you want to continue [Y/n]?
Get:1 http://${ubuntu_mirror_here}/pub/MariaDB/repo/5.5/ubuntu/ precise/main mariadb-server-core-5.5 amd64 5.5.36+maria-1~precise [5,366 kB]
Get:2 http://${ubuntu_mirror_here}/pub/MariaDB/repo/5.5/ubuntu/ precise/main mariadb-galera-server-5.5 amd64 5.5.36+maria-1~precise [24.0 MB]
Get:3 http://${ubuntu_mirror_here}/pub/MariaDB/repo/5.5/ubuntu/ precise/main mariadb-galera-server all 5.5.36+maria-1~precise [2,994 B]
Fetched 29.4 MB in 2s (9,949 kB/s)
Preconfiguring packages ...
Selecting previously unselected package mariadb-server-core-5.5.
(Reading database ... 72716 files and directories currently installed.)
Unpacking mariadb-server-core-5.5 (from .../mariadb-server-core-5.5_5.5.36+maria-1~precise_amd64.deb) ...
Unpacking mariadb-galera-server-5.5 (from .../mariadb-galera-server-5.5_5.5.36+maria-1~precise_amd64.deb) ...
dpkg: error processing /var/cache/apt/archives/mariadb-galera-server-5.5_5.5.36+maria-1~precise_amd64.deb (--unpack):
trying to overwrite '/usr/sbin/mysqld', which is also in package mariadb-server-core-5.5 5.5.36+maria-1~precise
dpkg-deb: error: subprocess paste was killed by signal (Broken pipe)
Selecting previously unselected package mariadb-galera-server.
Unpacking mariadb-galera-server (from .../mariadb-galera-server_5.5.36+maria-1~precise_all.deb) ...
Processing triggers for man-db ...
Processing triggers for ureadahead ...
Errors were encountered while processing:
/var/cache/apt/archives/mariadb-galera-server-5.5_5.5.36+maria-1~precise_amd64.deb
E: Sub-process /usr/bin/dpkg returned an error code (1)
更新 2:降级到之前的版本 5.5.35+maria-1~precise,暂时解决了这个问题。但这既不是真正的解决方案,也不是这个问题的好答案。
答案1
显然这些软件包已经合并了。以下是 MariaDB 网站上的通知,其中准确引用了您所说的内容:https://mariadb.com/kb/en/mariadb-galera-5529-release-notes/
其中一个显然现在是一个包含另一个的元包。
答案2
我怀疑这是一个包装错误,后来修复了,因为同样的问题不会发生在版本 5.5.38。因此,解决办法是不要使用损坏的软件包版本。