我有一台运行 Debian wheezy 的服务器,上面有 MaraiDB 和 OwnCloud。几天前,我想更新软件包,因为 OwnCloud 更新了,但出了点问题。
通常在这种情况下,我可能会尝试删除并再次安装有问题的软件包,但在由不同人使用的服务器上,这似乎不再是一个有效的解决方案。
在这里您可以看到我的控制台输出:
user@server:~$ sudo apt-get upgrade
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.4+maria-1~wheezy) but 10.0.5+maria-1~wheezy is installed
libmysqlclient18 : Depends: libmariadbclient18 (= 10.0.5+maria-1~wheezy) but 10.0.4+maria-1~wheezy is installed
mariadb-client-10.0 : Depends: libmariadbclient18 (>= 10.0.5+maria-1~wheezy) but 10.0.4+maria-1~wheezy is installed
mariadb-client-core-10.0 : Depends: libmariadbclient18 (>= 10.0.5+maria-1~wheezy) but 10.0.4+maria-1~wheezy is installed
mariadb-server : Depends: mariadb-server-10.0 (= 10.0.5+maria-1~wheezy) but 10.0.4+maria-1~wheezy is installed
mariadb-server-core-10.0 : Depends: libmariadbclient18 (>= 10.0.5+maria-1~wheezy) but 10.0.4+maria-1~wheezy is installed
E: Unmet dependencies. Try using -f.
user@server:~$ sudo apt-get upgrade -f
Reading package lists... Done
Building dependency tree
Reading state information... Done
Correcting dependencies... Done
The following packages will be upgraded:
libmariadbclient18 mariadb-server-10.0 owncloud
3 upgraded, 0 newly installed, 0 to remove and 0 not upgraded.
7 not fully installed or removed.
Need to get 0 B/37.2 MB of archives.
After this operation, 3,565 kB of additional disk space will be used.
Do you want to continue [Y/n]? Y
Preconfiguring packages ...
(Reading database ... 35901 files and directories currently installed.)
Preparing to replace libmariadbclient18 10.0.4+maria-1~wheezy (using .../libmariadbclient18_10.0.5+maria-1~wheezy_amd64.deb) ...
Unpacking replacement libmariadbclient18 ...
dpkg: error processing /var/cache/apt/archives/libmariadbclient18_10.0.5+maria-1~wheezy_amd64.deb (--unpack):
trying to overwrite '/usr/lib/mysql/plugin/dialog.so', which is also in package mariadb-server-10.0 10.0.4+maria-1~wheezy
Errors were encountered while processing:
/var/cache/apt/archives/libmariadbclient18_10.0.5+maria-1~wheezy_amd64.deb
E: Sub-process /usr/bin/dpkg returned an error code (1)
我尝试删除10.0.4
软件包版本,libmariadbclient18
但是并没有成功。
所以我的最后希望就在这里,你知道我该如何解决这个问题吗?
非常感谢
答案1
今天早上,我在两台 VPS 上遇到了这个问题。我“修复”它的唯一方法是使用 dpkg 将 10.0.5 软件包与 10.0.4 软件包一起回滚。这实际上不是一个修复,但这是我能想到的最好的办法,因为通常的 apt-get install -f 什么也没做。
dpkg -i /路径/到/old/10.0.4 debs