我在一台机器上安装了 Ubuntu 20.04.6 LTS,我想将操作系统升级到 24.04。我运行了apt update
和apt upgrade
。两者都成功运行,apt update 给出了一些警告。当我运行 时do-release-upgrade
,它给出
升级之前,请安装适合您的版本的所有可用更新。
运行时apt-update
,它发出以下警告
W: An error occurred during the signature verification. The repository is not updated and the previous index files will be used. GPG error: http://repo.mysql.com/apt/ubuntu focal InRelease: The following signatures couldn't be verified because the public key is not available: NO_PUBKEY B7B3B788A8D3785C
W: Failed to fetch http://repo.mysql.com/apt/ubuntu/dists/focal/InRelease The following signatures couldn't be verified because the public key is not available: NO_PUBKEY B7B3B788A8D3785C
W: Some index files failed to download. They have been ignored, or old ones used instead.
我尝试直接使用添加密钥
sudo apt-key adv --keyserver keyserver.ubuntu.com --recv-keys B7B3B788A8D3785C
但它给了gpg: keyserver receive failed: Network is unreachable
然后我在类似问题的帮助下尝试了以下命令
sudo apt-key adv --keyserver hkp://keyserver.ubuntu.com:80 --recv-keys B7B3B788A8D3785C
但它也会抛出gpg: keyserver receive failed: Connection timed out
我还尝试使用 ping 获取 keyserver.ubuntu.com 的 IP,并尝试以下命令:
sudo apt-key adv --keyserver 185.125.188.26 --recv-keys 467B942D3A79BD29
但它也给了我同样的gpg: keyserver receive failed: Connection timed out
我也尝试添加nameserver 8.8.8.8 # Google DNS
机器/etc/resolv.conf
,但问题仍然存在。
该机器位于防火墙和代理后面。
您可以使用此脚本来传递新的 gpg 密钥以添加:
用法:
好消息:这不是你做错的事;事实证明,MySQL 使用其 apt 存储库做了一些令人难以置信的复杂且愚蠢的事情。
根据他们自己的指南(在此处提供),您需要手动下载并安装
mysql-apt-config
包(在此处提供),它将(大概)配置一个 apt 存储库并下载您需要的密钥。...不,我也不知道他们为什么认为这是个好主意。
如果您不执意要使用现在受许可限制的 MySQL 版本,我可以借此机会建议您切换到MariaDB吗?它是一个完全开源的分支和替代品。