“sudo apt-get purge mysql”在 Ubuntu 16.04 LTS 上失败

“sudo apt-get purge mysql”在 Ubuntu 16.04 LTS 上失败

我不确定问题是什么,但我很确定出了什么问题严重地我的 MySQL 安装有错误。我尝试了以下链接中几乎所有的解决方案: 如何修复损坏的软件包安装(mysql)如何彻底删除 MySQL 以进行全新安装如何彻底卸载 MySQL?但不幸的是,什么都没起作用。当尝试这些解决方案时,都会产生一个常见的错误,如下所示:

The following packages have unmet dependencies:
 libmysqlclient20 : Depends: mysql-common (>= 5.7.20-1ubuntu16.04)
                    Breaks: libmysqlclient20:i386 (!= 5.7.20-1ubuntu16.04) but 5.7.20-0ubuntu0.16.04.1 is to be installed
 libmysqlclient20:i386 : Depends: mysql-common:i386 (>= 5.5)
                         Breaks: libmysqlclient20 (!= 5.7.20-0ubuntu0.16.04.1) but 5.7.20-1ubuntu16.04 is to be installed
E: Unmet dependencies. Try 'apt-get -f install' with no packages (or specify a solution).

整个错误消息和命令在这里:

sudo apt-get --yes purge mysql-apt-config mysql-common mysql-
community-server mysql-workbench-community mysql-client mysql-community-client mysql-server mythes-en-us 
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:
 libmysqlclient20 : Depends: mysql-common (>= 5.7.20-1ubuntu16.04)
                    Breaks: libmysqlclient20:i386 (!= 5.7.20-1ubuntu16.04) but 5.7.20-0ubuntu0.16.04.1 is to be installed
 libmysqlclient20:i386 : Depends: mysql-common:i386 (>= 5.5)
                         Breaks: libmysqlclient20 (!= 5.7.20-0ubuntu0.16.04.1) but 5.7.20-1ubuntu16.04 is to be installed
E: Unmet dependencies. Try 'apt-get -f install' with no packages (or specify a solution).

此错误尤其麻烦,因为 dpkg 和 apt-get 都因该错误而出现问题。如果这意味着我可以修复此错误,我完全愿意摆脱 MySQL。

有人对如何解决这个问题有建议吗?

答案1

我遇到了和你一样的问题。对我来说,解决方案是使用 dpkg 删除软件包:

sudo dpkg --remove --force-all libmysqlclient20:i386
sudo dpkg --remove --force-all libqt4-sql-mysql

希望它能帮助你...

相关内容