当前位置: 首页 > news >正文

[apt update docker 密钥问题]

问题输出

Get:26 http://mirrors.aliyun.com/ubuntu focal-backports/restricted amd64 DEP-11 Metadata [212 B]
Get:27 http://mirrors.aliyun.com/ubuntu focal-backports/universe amd64 DEP-11 Metadata [30.5 kB]
Get:28 http://mirrors.aliyun.com/ubuntu focal-backports/multiverse amd64 DEP-11 Metadata [212 B]
Reading package lists... Done
W: http://mirrors.aliyun.com/ubuntu/dists/focal/InRelease: Key is stored in legacy trusted.gpg keyring (/etc/apt/trusted.gpg), see the DEPRECATION section in apt-key(8) for details.
W: 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 7EA0A9C3F273FCD8
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.
W: http://mirrors.aliyun.com/ubuntu/dists/focal-security/InRelease: Key is stored in legacy trusted.gpg keyring (/etc/apt/trusted.gpg), see the DEPRECATION section in apt-key(8) for details.
W: http://mirrors.aliyun.com/ubuntu/dists/focal-updates/InRelease: Key is stored in legacy trusted.gpg keyring (/etc/apt/trusted.gpg), see the DEPRECATION section in apt-key(8) for details.
W: http://mirrors.aliyun.com/ubuntu/dists/focal-proposed/InRelease: Key is stored

image

![image](https://img2024.cnblogs.com/blog/1565547/202510/1565547-20251030170727794-101925165.png =700x400)

这是GPG密钥问题,主要有两个需要解决:

1. 修复Docker仓库密钥问题

# 添加Docker官方GPG密钥
curl -fsSL https://download.docker.com/linux/ubuntu/gpg | sudo gpg --dearmor -o /usr/share/keyrings/docker-archive-keyring.gpg
# 更新Docker仓库配置
echo "deb [arch=$(dpkg --print-architecture) 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

2. 修复Ubuntu仓库密钥警告

# 将Ubuntu密钥移动到新的keyring目录
sudo cp /etc/apt/trusted.gpg /etc/apt/trusted.gpg.d/

3. 更新软件包列表

sudo apt update

4. 如果还有问题,可以重新导入Ubuntu密钥

# 重新导入Ubuntu官方密钥
sudo apt-key adv --keyserver keyserver.ubuntu.com --recv-keys 871920D1991BC93C
# 或者使用更现代的方式
sudo apt install ubuntu-keyring

执行完这些步骤后,sudo apt update 应该就不会再报错了。Docker仓库的签名问题会得到解决,Ubuntu仓库的弃用警告也会消失。


以上内容由AI生成,仅供参考和借鉴

Debian

啊,原来是Debian系统!之前的配置是针对Ubuntu的。对于Debian系统(特别是bookworm,即Debian 12),需要这样修复:

1. 删除错误的Docker仓库配置

sudo rm /etc/apt/sources.list.d/docker.list

2. 为Debian添加正确的Docker仓库

# 添加Docker官方GPG密钥
curl -fsSL https://download.docker.com/linux/debian/gpg | sudo gpg --dearmor -o /usr/share/keyrings/docker-archive-keyring.gpg
# 添加Docker仓库(注意是debian,不是ubuntu)
echo "deb [arch=$(dpkg --print-architecture) signed-by=/usr/share/keyrings/docker-archive-keyring.gpg] https://download.docker.com/linux/debian bookworm stable" | sudo tee /etc/apt/sources.list.d/docker.list > /dev/null

3. 更新软件包列表

sudo apt update

4. 如果还有问题,检查Debian版本

lsb_release -cs
# 或者
cat /etc/os-release | grep VERSION_CODENAME

确保使用正确的Debian版本代号(bookworm、bullseye、buster等)。
关键区别是:

  • Ubuntu使用:https://download.docker.com/linux/ubuntu
  • Debian使用:https://download.docker.com/linux/debian
    现在应该就能正常工作了!

以上内容由AI生成,仅供参考和借鉴

http://www.jsqmd.com/news/26786/

相关文章:

  • 0300-Nand-表示代码
  • Python逻辑运算 _ 今年过节能收礼吗
  • ENGG5301 Information Theory 2025 Midterm Exam P3:Causal Encoding
  • 0291-Nand-实现基础逻辑门(一)
  • NASM下载和安装教程(附安装包)
  • 0292-Nand-实现基础逻辑门(二)
  • 单点登录SSO是怎么实现的?
  • 赋能智慧货运:视频汇聚平台EasyCVR打造货运汽车安全互联网视频监控与管理方案
  • 2025年上海房产继承律师权威推荐榜单:继承律师/离婚律师/婚姻律师事务所精选
  • 【SPIE出版、往届已EI检索】第二届遥感技术与图像处理国际学术会议(RSTIP 2025)
  • autotiny下载_v3.0.0.2
  • 2025 年井盖篦子最新推荐榜,技术实力与市场口碑深度解析铸铁套/树围/球墨铸铁单/溢流井/雨水井盖篦子公司推荐
  • Python嵌套_多条件判断 _ 对象今天会生气吗 II
  • 解析视频融合平台EasyCVR的分析平台技术如何成为“全域视频管理中台”
  • flink-连mongo db
  • uni-app x联系我们,地图显示,拨打电话
  • 统计接口耗时的6种常见方法
  • CSP近五年总结及2025预测及经验总结
  • 2025年线上英语培训机构权威推荐榜单:成人英语培训/英语口语教育/英语外教一对一源头机构精选
  • 常用脚本文件
  • 深入解析:GitPuk入门教程:安装及使用指南,一文轻松上手
  • 一种从未想过的网络流限制方式
  • 介绍一个我新开的仓库 `VictoriaLogs_AVX2`: 在官方 VictoriaLogs 的基础上打补丁来实现 avx2 指令集优化
  • 2025年叠元宝机器厂家权威推荐榜单:自动元宝机/金银元宝机 /全自动元宝机源头厂家精选
  • 完整教程:Linux启动流程与字符设备驱动详解 - 从bootloader到驱动开发
  • 学术会议会议合集 | 电子信息工程、计算机技术、文学、人文发展、数字经济等EI会议合集
  • 推出其新一代高性能Sub-GHz射频收发芯片-DP4330A
  • 基于mediapipe深度学习和限定半径最近邻分类树算法的人体摔倒检测系统python源码
  • Python条件语句 _ 对象今天会生气吗
  • Ai元人文:自主构建更丰富多彩