处理apt-get update遇到的PUB KEY GPG ERROR

公司的debian稳定运行很久了,一直没怎么动过,

今天同事告诉我说apt-get update不了,出现PGP错误。。。

 

google一下,找到两个比较靠的贴子:

http://en.kioskea.net/faq/sujet-809-debian-apt-get-no-pubkey-gpg-error

http://www.debian-administration.org/articles/174

 

其中后者在最后结出了最简捷快速的解决方案:

 

apt-get install debian-archive-keyring
apt-get update

 

备忘一下~

先正确配置 NVIDIA 机器学习源(关键!) RUN \ # 1. 导入 NVIDIA 机器学习源的官方密钥(避免签名验证失败) curl -fsSL https://developer.download.nvidia.com/compute/machine-learning/repos/ubuntu2204/x86_64/7fa2af80.pub | apt-key add - && \ # 2. 添加 x86_64 架构专用的 NVIDIA 机器学习源(确保包含 VPI 包) echo "deb https://developer.download.nvidia.com/compute/machine-learning/repos/ubuntu2204/x86_64/ /" > /etc/apt/sources.list.d/nvidia-ml.list && \ # 3. 更新源缓存(使新添加的源生效) apt-get update 这个会报错 => ERROR [10/21] RUN curl -fsSL https://developer.download.nvidia.co 2.4s ------ > [10/21] RUN curl -fsSL https://developer.download.nvidia.com/compute/machine-learning/repos/ubuntu2204/x86_64/7fa2af80.pub | apt-key add - && echo "deb https://developer.download.nvidia.com/compute/machine-learning/repos/ubuntu2204/x86_64/ /" > /etc/apt/sources.list.d/nvidia-ml.list && apt-get update: 0.301 Warning: apt-key is deprecated. Manage keyring files in trusted.gpg.d instead (see apt-key(8)). 0.305 E: This command can only be used by root. 2.369 curl: (22) The requested URL returned error: 404 ------ Dockerfile:111 -------------------- 110 | # 前置步骤:先正确配置 NVIDIA 机器学习源(关键!) 111 | >>> RUN \ 112 | >>> # 1. 导入 NVIDIA 机器学习源的官方密钥(避免签名验证失败) 113 | >>> curl -fsSL https://developer.download.nvidia.com/compute/machine-learning/repos/ubuntu2204/x86_64/7fa2af80.pub | apt-key add - && \ 114 | >>> # 2. 添加 x86_64 架构专用的 NVIDIA 机器学习源(确保包含 VPI 包) 115 | >>> echo "deb https://developer.download.nvidia.com/compute/machine-learning/repos/ubuntu2204/x86_64/ /" > /etc/apt/sources.list.d/nvidia-ml.list && \ 116 | >>> # 3. 更新源缓存(使新添加的源生效) 117 | >>> apt-get update 118 | -------------------- ERROR: failed to build: failed to solve: process "/bin/sh -c curl -fsSL https://developer.download.nvidia.com/compute/machine-learning/repos/ubuntu2204/x86_64/7fa2af80.pub | apt-key add - && echo \"deb https://developer.download.nvidia.com/compute/machine-learning/repos/ubuntu2204/x86_64/ /\" > /etc/apt/sources.list.d/nvidia-ml.list && apt-get update" did not complete successfully: exit code: 1
10-17
def@abc:~/Desktop$ sudo apt-key adv --keyserver keyserver.ubuntu.com --recv-keys 7EA0A9C3F273FCD8 Warning: apt-key is deprecated. Manage keyring files in trusted.gpg.d instead (see apt-key(8)). Executing: /tmp/apt-key-gpghome.kyNzFH26Ch/gpg.1.sh --keyserver keyserver.ubuntu.com --recv-keys 7EA0A9C3F273FCD8 gpg: key 8D81803C0EBFCD88: 1 duplicate signature removed gpg: key 8D81803C0EBFCD88: "Docker Release (CE deb) <docker@docker.com>" not changed gpg: Total number processed: 1 gpg: unchanged: 1 def@abc:~/Desktop$ sudo apt-get update Ign:1 https://download.docker.com/linux/ubuntu noble InRelease Hit:2 https://mirrors.aliyun.com/docker-ce/linux/ubuntu noble InRelease Hit:3 http://apt.postgresql.org/pub/repos/apt noble-pgdg InRelease Hit:4 http://mirrors.tuna.tsinghua.edu.cn/ubuntu noble InRelease Hit:5 http://security.ubuntu.com/ubuntu noble-security InRelease Ign:1 https://download.docker.com/linux/ubuntu noble InRelease Hit:6 http://mirrors.tuna.tsinghua.edu.cn/ubuntu noble-updates InRelease Hit:7 http://mirrors.tuna.tsinghua.edu.cn/ubuntu noble-backports InRelease Ign:1 https://download.docker.com/linux/ubuntu noble InRelease Get:1 https://download.docker.com/linux/ubuntu noble InRelease [48.8 kB] Err:1 https://download.docker.com/linux/ubuntu noble InRelease The following signatures couldn't be verified because the public key is not available: NO_PUBKEY 7EA0A9C3F273FCD8 Reading package lists... Done W: http://apt.postgresql.org/pub/repos/apt/dists/noble-pgdg/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 noble 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 noble 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. def@abc:~/Desktop$
09-04
评论
成就一亿技术人!
拼手气红包6.0元
还能输入1000个字符
 
红包 添加红包
表情包 插入表情
 条评论被折叠 查看
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值