sudo apt-get purge mysql-client-8.0 mysql-server-8.0 mysql-server-core-8.0
Reading package lists... Done
Building dependency tree... Done
Reading state information... Done
Package 'mysql-client-8.0' is not installed, so not removed
Package 'mysql-server-8.0' is not installed, so not removed
Package 'mysql-server-core-8.0' is not installed, so not removed
0 upgraded, 0 newly installed, 0 to remove and 0 not upgraded.
sudo apt-get autoremove sudo apt-get autoclean
Reading package lists... Done
Building dependency tree... Done
Reading state information... Done
0 upgraded, 0 newly installed, 0 to remove and 0 not upgraded.
Reading package lists... Done
Building dependency tree... Done
Reading state information... Done
Del thermald 2.4.9-1ubuntu0.3 [222 kB]
sudo apt-get install mysql-server
Reading package lists... Done
Building dependency tree... Done
Reading state information... Done
Some packages could not be installed. This may mean that you have
requested an impossible situation or if you are using the unstable
distribution that some required packages have not yet been created
or been moved out of Incoming.
The following information may help to resolve the situation:
The following packages have unmet dependencies:
mysql-common : Conflicts: mysql-server-8.0 but 8.0.34-0ubuntu0.22.04.1 is to be installed
mysql-server-8.0 : Depends: mysql-client-8.0 (>= 8.0.34-0ubuntu0.22.04.1) but it is not installable
Depends: mysql-server-core-8.0 (= 8.0.34-0ubuntu0.22.04.1) but it is not installable
E: Unable to correct problems, you have held broken packages.
我有未满足的依赖项,即使它们已被删除。我不明白。
谢谢!
编辑:
我已重新安装旧快照以保持我的网站在线。于是又安装了旧版本的mysql8.0。我得到了未满足的依赖关系。
apt policy mysql-common
mysql-common:
Installed: 8.0.33-1ubuntu18.04
Candidate: 8.0.33-1ubuntu18.04
Version table:
*** 8.0.33-1ubuntu18.04 500
500 http://repo.mysql.com/apt/ubuntu bionic/mysql-8.0 amd64 Packages
100 /var/lib/dpkg/status
5.8+1.0.8 500
500 http://mirrors.digitalocean.com/ubuntu jammy/main amd64 Packages
dpkg -l | grep mysql
ii dbconfig-mysql 2.0.21 all dbconfig-common MySQL/MariaDB support
ii mysql-apt-config 0.8.24-1 all Auto configuration for MySQL APT Repo.
ii mysql-client 8.0.33-1ubuntu18.04 amd64 MySQL Client meta package depending on latest version
ii mysql-common 8.0.33-1ubuntu18.04 amd64 Common files shared between packages
ii mysql-community-client 8.0.33-1ubuntu18.04 amd64 MySQL Client
ii mysql-community-client-core 8.0.33-1ubuntu18.04 amd64 MySQL Client Core Binaries
ii mysql-community-client-plugins 8.0.33-1ubuntu18.04 amd64 MySQL Client plugin
ii mysql-community-server 8.0.33-1ubuntu18.04 amd64 MySQL Server
ii mysql-community-server-core 8.0.33-1ubuntu18.04 amd64 MySQL Server Core Binaires
ii mysql-server 8.0.33-1ubuntu18.04 amd64 MySQL Server meta package depending on latest version
rc mysql-server-5.7 5.7.33-0ubuntu0.18.04.1 amd64 MySQL database server binaries and system database setup
ii php-mariadb-mysql-kbs 1.2.12-1 all Knowledge base about MariaDB and MySQL server variables
ii php-mysql 2:8.1+92ubuntu1 all MySQL module for PHP [default]
ii php8.1-mysql 8.1.2-1ubuntu2.13 amd64 MySQL module for PHP
sudo apt update
Hit:1 http://repo.mysql.com/apt/ubuntu bionic InRelease
Hit:2 http://security.ubuntu.com/ubuntu jammy-security InRelease
Hit:3 https://repos.insights.digitalocean.com/apt/do-agent main InRelease
Get:4 http://mirrors.digitalocean.com/ubuntu jammy InRelease [270 kB]
Hit:5 https://updates.signal.org/desktop/apt xenial InRelease
Hit:6 http://mirrors.digitalocean.com/ubuntu jammy-updates InRelease
Hit:7 http://mirrors.digitalocean.com/ubuntu jammy-backports InRelease
Fetched 270 kB in 1s (390 kB/s)
Reading package lists... Done
Building dependency tree... Done
Reading state information... Done
2 packages can be upgraded. Run 'apt list --upgradable' to see them.
apt list --upgradable
Listing... Done
mysql-client/jammy-updates,jammy-security 8.0.34-0ubuntu0.22.04.1 amd64 [upgradable from: 8.0.33-1ubuntu18.04]
mysql-server/jammy-updates,jammy-security 8.0.34-0ubuntu0.22.04.1 amd64 [upgradable from: 8.0.33-1ubuntu18.04]
apt install mysql-client mysql-server
Reading package lists... Done
Building dependency tree... Done
Reading state information... Done
Some packages could not be installed. This may mean that you have
requested an impossible situation or if you are using the unstable
distribution that some required packages have not yet been created
or been moved out of Incoming.
The following information may help to resolve the situation:
The following packages have unmet dependencies:
mysql-common : Conflicts: mysql-client-8.0 but 8.0.34-0ubuntu0.22.04.1 is to be installed
Conflicts: mysql-client-core-8.0 but 8.0.34-0ubuntu0.22.04.1 is to be installed
mysql-server : Depends: mysql-server-8.0 but it is not installable
E: Unable to correct problems, you have held broken packages.
谢谢!
第一次恢复jammy 的默认存储库。
认同
如果此存储库 repo.mysql.com处于活动状态,请将其删除。
这首先是模拟。为了彻底删除。
刷新包缓存。
然后再试一次。