linux - sudo apt update 被 ubuntu 中的 403 错误中断

标签 linux docker ubuntu terminal

我正在尝试更新我的存储库,但我不断收到来自 docker 的错误,我不知道如何修复它。
错误:

Failed to fetch https://download.docker.com/linux/ubuntu/dists/focal/InRelease  
403  Forbidden [IP: 2600:9000:2251:e800:3:db06:4200:93a1 443]
 E: The repository 'https://download.docker.com/linux/ubuntu focal InRelease' is not signed.
 N: Updating from such a repository can't be done securely, and is therefore disabled by default.
 N: See apt-secure(8) manpage for repository creation and user configuration details.
我假设我必须手动将 InRelease 文件添加到 docker,但我需要指导,因为我对 ubuntu 完全陌生。

最佳答案

您是否在 official docker installation 之后添加了官方 GPG key ?在ubuntu上?

sudo apt-get update
sudo apt-get install apt-transport-https ca-certificates curl gnupg lsb-release

curl -fsSL https://download.docker.com/linux/ubuntu/gpg | sudo gpg --dearmor -o /usr/share/keyrings/docker-archive-keyring.gpg
假设您在 x86_64/amd64 系统上,执行:
 echo "deb [arch=amd64 signed-by=/usr/share/keyrings/docker-archive-keyring.gpg] https://download.docker.com/linux/ubuntu $(lsb_release -cs) stable" | sudo tee /etc/apt/sources.list.d/docker.list > /dev/null
我建议您遵循该指南,而不是通过 apt 安装。

关于linux - sudo apt update 被 ubuntu 中的 403 错误中断,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/69346744/

相关文章:

docker - JanusGraph 在 Docker 环境中无法与 Cassandra 后端通信

asp.net - 为什么docker build在我的复制路径前添加一个临时目录?

docker - 如何通过主机名访问 docker 容器?(来 self 的主机)

java - 如何修复 Ubuntu 10 上的 Netbeans 7.0 严重损坏的外观问题

linux - Docker 会清除旧的/未使用的图像吗?

Linux/awk 将包含十进制的文件转换为十六进制

linux - 尝试RUN时Openresty Docker容器,返回nginx : invalid option: "/bin/sh"

linux - 如何根据 2 个或更多列值拆分文件

linux - 运行服务启动脚本时未加载环境变量

java - 如何在 Ubuntu 10.10 (Maverick Meerkat) 上安装 Sun Java JDK?