我是 debian 新手,我正在尝试安装 mysql,但是当我执行以下命令时:
sudo apt-get update
sudo apt-get upgrade
sudo apt-get install mysql-server
那么就会出现这个错误:
Reading package lists... Done
Building dependency tree
Reading state information... Done
Package mysql-server is not available, but is referred to by another package.
This may mean that the package is missing, has been obsoleted, or
is only available from another source
E: Package 'mysql-server' has no installation candidate
另外,当我使用命令 sudo apt-get update 时,会出现此错误:
Ign:8 https://repo.mysql.com/apt/debian/dists/buster/mysql-8.0/binary-amd64/Packages buster InRelease
Ign:9 https://repo.mysql.com/apt/debian/dists/buster/mysql-tools/binary-i386/Packages buster InRelease
Err:10 https://repo.mysql.com/apt/debian/dists/buster/mysql-8.0/binary-amd64/Packages buster Release
Redirection from https to 'http://www.mysql.com/downloads/embargo.html' is forbidden [IP: 2.20.149.25 443]
Ign:11 http://ppa.launchpad.net/webupd8team/atom/ubuntu eoan InRelease
Err:12 https://repo.mysql.com/apt/debian/dists/buster/mysql-tools/binary-i386/Packages buster Release
Redirection from https to 'http://www.mysql.com/downloads/embargo.html' is forbidden [IP: 2.20.149.25 443]
Err:13 http://ppa.launchpad.net/noobslab/apps/ubuntu eoan Release
404 Not Found [IP: 91.189.95.83 80]
答案1
在 Debian 中,标准存储库中没有 MySql。有一个名为 MariaDB 的等效项以及相应的包mariadb-server
。至于错误,您一定遵循了(我猜)一些教程,并在存储库中引入了一些混乱,您现在很可能应该清理它们。我会尝试找出存储库列表中到底添加了哪些内容、安装了哪些内容以及现在应该删除哪些内容。您可以从 shell 历史记录以及可能的包管理日志中获取此信息。
为了给出更全面的答案,您可能想要坚持使用 MySql 并从其安装程序中安装它,但请确保您确实想要这样做。与 Debian 的默认 MariaDB 相比,这是一种更困难的方法。