
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.
謝謝!
答案1
對於第一次恢復預設儲存庫為了傑米。
認同
grep -r deb /etc/apt/sources.list /etc/apt/sources.list.d/
這個倉庫在哪裡 repo.mysql.com處於活動狀態並將其刪除。
sudo apt -s purge $(dpkg -l | grep mysql | awk '{print $2}')
這首先是模擬。為了徹底刪除。
sudo apt purge $(dpkg -l | grep mysql | awk '{print $2}')
刷新包緩存。
sudo apt update
然後再試一次。