You need to enable JavaScript to run this app.
优惠活动
大模型
产品
解决方案
定价
更多

Ubuntu 20.04下MySQL/MariaDB无法升级、卸载等操作的依赖问题求助

Ubuntu 20.04下MySQL/MariaDB无法升级、卸载等操作的依赖问题求助

大家好,我在Ubuntu 20.04上尝试升级MySQL时卡壳了,每次操作都会弹出依赖错误提示,折腾了好一阵都没搞定,想问问有没有朋友遇到过类似问题,给点解决思路:

The following packages have unmet dependencies:

mysql-server-8.0 : Depends: mysql-server-core-8.0 (= 8.0.31-0ubuntu0.20.04.1) but 8.0.31-0ubuntu0.20.04.2 is to be installed

E: Unmet dependencies. Try 'apt --fix-broken install' with no packages (or specify a solution).

先给大家贴一下当前apt list --installed里的MySQL相关包情况:

libmysqlclient20/xenial-security,now 5.7.33-0ubuntu0.16.04.1 amd64 [installed]

libmysqlclient21/focal-security,now 8.0.31-0ubuntu0.20.04.1 amd64 [installed,upgradable to: 8.0.31-0ubuntu0.20.04.2]

mysql-client-8.0/focal-updates,now 8.0.31-0ubuntu0.20.04.2 amd64 [installed,automatic]

mysql-client-core-8.0/focal-updates,now 8.0.31-0ubuntu0.20.04.2 amd64 [installed,automatic]

mysql-client/focal-security,now 8.0.31-0ubuntu0.20.04.1 all [installed,upgradable to: 8.0.31-0ubuntu0.20.04.2]

mysql-common/focal,now 5.8+1.0.5ubuntu2 all [installed]

mysql-server-8.0/focal-security,now 8.0.31-0ubuntu0.20.04.1 amd64 [installed,upgradable to: 8.0.31-0ubuntu0.20.04.2]

mysql-server-core-8.0/focal-updates,now 8.0.31-0ubuntu0.20.04.2 amd64 [installed,auto-removable]

mysql-server/focal-security,now 8.0.31-0ubuntu0.20.04.1 all [installed,upgradable to: 8.0.31-0ubuntu0.20.04.2]

php-mysql/focal,now 2:7.4+75 all [installed,automatic]

php7.4-mysql/focal-updates,focal-security,now 7.4.3-4ubuntu2.15 amd64 [installed,automatic]

还有dpkg -l的输出结果:

||/ Name                  Version                 Architecture Description
+++-=====================-=======================-============-===================================================================
ii  mysql-client          8.0.31-0ubuntu0.20.04.1 all          MySQL database client (metapackage depending on the latest version)
un  mysql-client-5.7      <none>                  <none>       (no description available)
ii  mysql-client-8.0      8.0.31-0ubuntu0.20.04.2 amd64        MySQL database client binaries
un  mysql-client-core-5.7 <none>                  <none>       (no description available)
ii  mysql-client-core-8.0 8.0.31-0ubuntu0.20.04.2 amd64        MySQL database core client binaries
ii  mysql-common          5.8+1.0.5ubuntu2        all          MySQL database common files, e.g. /etc/mysql/my.cnf
un  mysql-common-5.6      <none>                  <none>       (no description available)
ii  mysql-server          8.0.31-0ubuntu0.20.04.1 all          MySQL database server (metapackage depending on the latest version)
un  mysql-server-5.5      <none>                  <none>       (no description available)
un  mysql-server-5.7      <none>                  <none>       (no description available)
pFR mysql-server-8.0      8.0.31-0ubuntu0.20.04.1 amd64        MySQL database server binaries and system database setup
un  mysql-server-core-5.7 <none>                  <none>       (no description available)
ii  mysql-server-core-8.0 8.0.31-0ubuntu0.20.04.2 amd64        MySQL database server binaries

我已经尝试过把/var/dpkg/lib/info和/var/cache/apt目录下所有带mysql*和libmysql*的文件夹、文件都彻底删除了,但问题依然存在。有没有大佬能指点一下该怎么处理这个依赖冲突呀?

备注:内容来源于stack exchange,提问作者Redbob

相关产品推荐
方舟 Agent Plan

超全模态模型 × Harness 升级,最新支持 Deepseek-V4.1-Flash、GLM-5.3 系列、Doubao-Seedream-5.0-pro、Kimi-K3 (部分), 限时 9.9 元起

最近更新时间:2026.04.23 07:43:02