无法安装 mysql-server,出现错误,您持有损坏的软件包

无法安装 mysql-server,出现错误,您持有损坏的软件包

使用以下命令

1.sudo apt 更新
2.sudo apt 安装 mysql 服务器

出现以下错误

Reading package lists... Done
Building dependency tree       
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-server : Depends: mysql-server-5.7 but it is not going to be installed
E: Unable to correct problems, you have held broken packages.

有什么帮助吗?

答案1

我的朋友。看来你的存储库有一个错误。

因此,首先,从发行版中删除所有非官方存储库。或者第三方存储库。

然后,运行

sudo apt update

然后你就可以通过添加官方存储库来安装 MySQL 8

wget https://dev.mysql.com/get/mysql-apt-config_0.8.14-1_all.deb
sudo dpkg -i mysql-apt-config_0.8.14-1_all.deb

再次刷新 APT

sudo apt update

并执行 MySQL 安装

sudo apt install mysql-server 

您还可以安装客户端。

这里是參考。應該足够了。

相关内容