无法使用‘sudo apt install mysql-server’安装 mysql-server

无法使用‘sudo apt install mysql-server’安装 mysql-server

我是新来的Linux的我遇到了一个问题:无法安装mysql下载 mysql-apt-config_0.8.17-1_all.debmysql 官方页面并使用以下配置它:

sudo dpkg -i mysql-apt-config_0.8.17-1_all.deb我有:

(Reading database ... 360760 files and directories currently installed.)
Preparing to unpack .../mysql-apt-config_0.8.17-1_all.deb ...
Unpacking mysql-apt-config (0.8.17-1) over (0.8.17-1) ...
Setting up mysql-apt-config (0.8.17-1) ...
Warning: apt-key should not be used in scripts (called from postinst maintainerscript of the package mysql-apt-config)
OK

sudo dpkg-reconfigure mysql-apt-config我有:

Warning: apt-key should not be used in scripts (called from postinst maintainerscript of the package mysql-apt-config)
OK

什么时候打字 sudo apt install mysql-server我有:

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-community-server (= 8.0.24-1ubuntu16.04) but it is not going to be installed
E: Unable to correct problems, you have held broken packages.

我正在看互联网修复此问题的方法,但我找不到解决方案。

我在用着Linux Mint


更新:

运行命令 lsb_release -cs 来打印您的版本。

lsb_release-cs

但是,您应该使用 apt 来安装而不是 dpkg,例如 sudo apt install ./mysql-apt-config_0.8.17-1_all.deb

使用:sudo apt install ./mysql-apt-config_0.8.17-1_all.deb

[sudo] password for dev:     
Reading package lists... Done
Building dependency tree       
Reading state information... Done
Note, selecting 'mysql-apt-config' instead of './mysql-apt-config_0.8.17-1_all.deb'
mysql-apt-config is already the newest version (0.8.17-1).
0 upgraded, 0 newly installed, 0 to remove and 1 not upgraded.

答案1

mysql 存储库配置错误,因为使用的代号是xenial而不是focal。使用以下命令修复 mysql 存储库(Ulyssa 基于 Focal):

sudo sed -i 's/xenial/focal/g' /etc/apt/sources.list.d/mysql.list

然后运行:

sudo apt update
sudo apt install mysql-server

相关内容