在尝试在Ubuntu 20.04安装mysql时,出现了未满足的依赖关系

6

我试图在Ubuntu 20.04上安装/卸载、重新安装/修复Mysql和Workbench,但总是会收到以下信息:

Building dependency tree       
Reading state information... Done
mysql-server is already the newest version (8.0.20-2ubuntu20.04).
You might want to run 'apt --fix-broken install' to correct these.
The following packages have unmet dependencies:
 libmysqlclient21 : Depends: mysql-common (>= 8.0.20-2ubuntu20.04) but 5.8+1.0.5ubuntu2 is to be installed
 mysql-client : Depends: mysql-community-client (= 8.0.20-2ubuntu20.04) but it is not installable
 mysql-community-test : Depends: mysql-community-server (= 8.0.20-2ubuntu20.04) but it is not installable
                        Depends: mysql-community-client (= 8.0.20-2ubuntu20.04) but it is not installable
                        Depends: libjson-perl but it is not going to be installed
                        Depends: mysql-community-server-core but it is not installable
 mysql-server : Depends: mysql-community-server (= 8.0.20-2ubuntu20.04) but it is not installable
E: Unmet dependencies. Try 'apt --fix-broken install' with no packages (or specify a solution).

当我尝试运行sudo apt --fix-broken install时,出现以下内容:

The following packages have unmet dependencies:
 libmysqlclient21 : Depends: mysql-common (>= 8.0.20-2ubuntu20.04) but 5.8+1.0.5ubuntu2 is installed
 mysql-client : Depends: mysql-community-client (= 8.0.20-2ubuntu20.04) but it is not installable
 mysql-community-test : Depends: mysql-community-server (= 8.0.20-2ubuntu20.04) but it is not installable
                        Depends: mysql-community-client (= 8.0.20-2ubuntu20.04) but it is not installable
                        Depends: libjson-perl but it is not installed
                        Depends: mysql-community-server-core but it is not installable
 mysql-server : Depends: mysql-community-server (= 8.0.20-2ubuntu20.04) but it is not installable
E: Error, pkgProblemResolver::Resolve generated breaks, this may be caused by held packages.
E: Unable to correct dependencies

对不起,我相信有一个简单的解决方案...但是我找不到它。


我投票关闭此问题,因为它更适合在askubuntu.com上提问。 - rkosegi
1个回答

4
尝试运行以下命令以卸载软件包:sudo apt autoremove libmysqlclient21 mysql-client mysql-community-test mysql-server。如果出现其他新的未满足依赖项,请在上述命令末尾添加相应的软件包。这是因为当有多个软件包相互依赖时,仅删除一个可能会破坏依赖计数。因此同时删除它们可以确保没有损坏的软件包。如果遇到其他问题,请恢复。

它总是出现相同的错误。我该如何解决这个问题? - Mijanur Rahman

网页内容由stack overflow 提供, 点击上面的
可以查看英文原文,
原文链接