安装 docker 后更新存储库时遇到问题

安装 docker 后更新存储库时遇到问题

安装 docker 后,当我尝试使用该sudo 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: https://download.docker.com/linux/ubuntu focal InRelease: The following signatures couldn't be verified because the public key is not available: NO_PUBKEY 7EA0A9C34573JCD8
W: Failed to fetch https://download.docker.com/linux/ubuntu/dists/focal/InRelease  The following signatures couldn't be verified because the public key is not available: NO_PUBKEY 7EA0A9C34573JCD8
W: Some index files failed to download. They have been ignored, or old ones used instead.

答案1

看起来您还没有添加docker存储库的官方gpg密钥。打开终端并执行以下命令。

curl -fsSL https://download.docker.com/linux/ubuntu/gpg | sudo apt-key add -

答案2

我编辑了:

/etc/apt/sources.list

使用 vim 编辑器:sudo vim /etc/apt/sources.list 我在包含 docker 链接的行开头放置了一个 # 字符。

# deb-src [arch=amd64] https://download.docker.com/linux/ubuntu focal stable

相关内容