首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >无法安装mysql-server与'sudo apt安装mysql-server‘

无法安装mysql-server与'sudo apt安装mysql-server‘
EN

Ask Ubuntu用户
提问于 2021-04-28 17:08:13
回答 1查看 6.1K关注 0票数 0

我是linux的新手,我遇到了一个问题:在从mysql-apt-config_0.8.17-1_all.deb下载mysql官方页面并使用以下方法配置它之后,无法安装mysql:

我得到了sudo dpkg -i mysql-apt-config_0.8.17-1_all.deb

代码语言:javascript
复制
(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

代码语言:javascript
复制
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时,我得到:

代码语言:javascript
复制
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

更新:

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

但是,您应该使用apt来安装,而不是像这样使用dpkg来安装./mysql-_0.8.17-1_all.deb

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

代码语言:javascript
复制
[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.
EN

回答 1

Ask Ubuntu用户

发布于 2021-04-28 23:04:20

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

代码语言:javascript
复制
sudo sed -i 's/xenial/focal/g' /etc/apt/sources.list.d/mysql.list

然后跑:

代码语言:javascript
复制
sudo apt update
sudo apt install mysql-server
票数 4
EN
页面原文内容由Ask Ubuntu提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://askubuntu.com/questions/1334661

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档