GPG error golang 1.19

news/2024/12/22 1:57:31/

1. 问题描述及原因分析

在飞腾2000+的服务器,OS为Kylin Linux Advanced Server release V10环境下,docker版本为18.09.0(docker-engine-18.09.0-101.ky10.aarch64),基于容器镜像golang:1.19编译新的容器镜像,报如下错误:

Get:1 http://deb.debian.org/debian bookworm InRelease [151 kB]
Err:1 http://deb.debian.org/debian bookworm InReleaseThe following signatures couldn't be verified because the public key is not available: NO_PUBKEY 0E98404D386FA1D9 NO_PUBKEY 6ED0E7B82643E131 NO_PUBKEY F8D2585B8783D481
Get:2 http://deb.debian.org/debian bookworm-updates InRelease [55.4 kB]
Err:2 http://deb.debian.org/debian bookworm-updates InReleaseThe following signatures couldn't be verified because the public key is not available: NO_PUBKEY 0E98404D386FA1D9 NO_PUBKEY 6ED0E7B82643E131
Get:3 http://deb.debian.org/debian-security bookworm-security InRelease [48.0 kB]
Err:3 http://deb.debian.org/debian-security bookworm-security InReleaseThe following signatures couldn't be verified because the public key is not available: NO_PUBKEY 54404762BBB6E853 NO_PUBKEY BDE6D2B9216EC7A8
Reading package lists... Done
W: GPG error: http://deb.debian.org/debian bookworm InRelease: The following signatures couldn't be verified because the public key is not available: NO_PUBKEY 0E98404D386FA1D9 NO_PUBKEY 6ED0E7B82643E131 NO_PUBKEY F8D2585B8783D481
E: The repository 'http://deb.debian.org/debian bookworm 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: GPG error: http://deb.debian.org/debian bookworm-updates InRelease: The following signatures couldn't be verified because the public key is not available: NO_PUBKEY 0E98404D386FA1D9 NO_PUBKEY 6ED0E7B82643E131
E: The repository 'http://deb.debian.org/debian bookworm-updates 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: GPG error: http://deb.debian.org/debian-security bookworm-security InRelease: The following signatures couldn't be verified because the public key is not available: NO_PUBKEY 54404762BBB6E853 NO_PUBKEY BDE6D2B9216EC7A8
E: The repository 'http://deb.debian.org/debian-security bookworm-security 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.

按照网上搜索的方法,通过apt-key命令处理,仍然无法解决

#apt-key adv --keyserver keyserver.ubuntu.com --recv-keys 0E98404D386FA1D9
#apt-key adv --keyserver keyserver.ubuntu.com --recv-keys 6ED0E7B82643E131
#apt-key adv --keyserver keyserver.ubuntu.com --recv-keys F8D2585B8783D481
Warning: apt-key is deprecated. Manage keyring files in trusted.gpg.d instead (see apt-key(8)).

换成国内的源/etc/apt/sources.list

deb https://mirrors.aliyun.com/debian/ bookworm main non-free non-free-firmware contrib
deb-src https://mirrors.aliyun.com/debian/ bookworm main non-free non-free-firmware contrib
deb https://mirrors.aliyun.com/debian-security/ bookworm-security main
deb-src https://mirrors.aliyun.com/debian-security/ bookworm-security main
deb https://mirrors.aliyun.com/debian/ bookworm-updates main non-free non-free-firmware contrib
deb-src https://mirrors.aliyun.com/debian/ bookworm-updates main non-free non-free-firmware contrib
deb https://mirrors.aliyun.com/debian/ bookworm-backports main non-free non-free-firmware contrib
deb-src https://mirrors.aliyun.com/debian/ bookworm-backports main non-free non-free-firmware contrib

执行apt update,已然报错如下:

Get:1 https://mirrors.aliyun.com/debian bookworm InRelease [151 kB]
Get:2 https://mirrors.aliyun.com/debian-security bookworm-security InRelease [48.0 kB]
Err:1 https://mirrors.aliyun.com/debian bookworm InReleaseAt least one invalid signature was encountered.
Err:2 https://mirrors.aliyun.com/debian-security bookworm-security InReleaseAt least one invalid signature was encountered.
Get:3 https://mirrors.aliyun.com/debian bookworm-updates InRelease [55.4 kB]
Get:4 https://mirrors.aliyun.com/debian bookworm-backports InRelease [59.0 kB]
Err:3 https://mirrors.aliyun.com/debian bookworm-updates InReleaseAt least one invalid signature was encountered.
Err:4 https://mirrors.aliyun.com/debian bookworm-backports InReleaseAt least one invalid signature was encountered.
Reading package lists... Done
W: GPG error: https://mirrors.aliyun.com/debian bookworm InRelease: At least one invalid signature was encountered.
E: The repository 'https://mirrors.aliyun.com/debian bookworm 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: GPG error: https://mirrors.aliyun.com/debian-security bookworm-security InRelease: At least one invalid signature was encountered.
E: The repository 'https://mirrors.aliyun.com/debian-security bookworm-security 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: GPG error: https://mirrors.aliyun.com/debian bookworm-updates InRelease: At least one invalid signature was encountered.
E: The repository 'https://mirrors.aliyun.com/debian bookworm-updates 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: GPG error: https://mirrors.aliyun.com/debian bookworm-backports InRelease: At least one invalid signature was encountered.
E: The repository 'https://mirrors.aliyun.com/debian bookworm-backports 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.

查阅了相关资料,通过gpg更新trusted.gpg.d下问题等等依然解决不了问题。无意中发现issues/1417问题有些类似,估计与docker版本有关,版本过低,升级到20.10.9,重新编译容器镜像成功了。
以下为通过apt update手动验证截图
在这里插入图片描述


2. 解决方案:

通过网址在https://download.docker.com/linux/static/stable/aarch64/下载20.10.9版本的docker,进行升级,golang:1.19镜像的里面的源采用国内的源进行加速,GPG error问题得以解决。

3.参考文献

https://forums.debian.net/viewtopic.php?t=155019
https://download.docker.com/linux/static/stable/aarch64/
https://gist.github.com/hakerdefo/5e1f51fa93ff37871b9ff738b05ba30f
https://www.osgeo.cn/post/195a2
https://github.com/docker-library/php/issues/1417
https://github.com/docker-library/python/issues/837#issuecomment-1593437629
https://github.com/golang/go/issues/60803
https://forums.debian.net/viewtopic.php?t=155019
https://www.reddit.com/r/debian/comments/178burx/what_are_your_sourceslist_lines_in_debian_12/?rdt=44726


http://www.ppmy.cn/news/1533901.html

相关文章

软件测试面试八股文(含答案+文档)

🍅 点击文末小卡片,免费获取软件测试全套资料,资料在手,涨薪更快 Part1 1、你的测试职业发展是什么? 测试经验越多,测试能力越高。所以我的职业发展是需要时间积累的,一步步向着高级测试工程师…

音视频入门基础:FLV专题(8)——FFmpeg源码中,解码Tag header的实现

一、引言 在《音视频入门基础:FLV专题(7)——Tag header简介》中对Tag header进行了简介,本文讲述FFmpeg源码中是怎样解码FLV文件的Tag header,拿到里面的信息。 二、FFmpeg源码中,解码Tag header的实现 …

Transformer架构分析

1 encoder 每个称之为一个layer,重复N次 每个里面有两个sublayer;multi-head self-attention MLP后面使用layer normalization LayerNorm(x Sublayer(x)) 残差连接需要两个维度一致,本文采用513。 2 decoder 3 注意力机制 输出维度和val…

空间计算/XR的现状:Meta Orion的优势与挑战

2024年初,苹果公司发布了Apple Vision Pro,这标志着空间计算/XR技术进入了一个新的阶段——双子座(Gemini)阶段。与此同时,Meta推出的Orion AR眼镜进一步确认了这一趋势。XR领域的关键意见领袖Rony Abovitz对Orion进行了深入分析,指出了其优势、亮点以及尚待改进的部分。…

【LeetCode】每日一题 2024_9_30 座位预约管理系统(堆)

前言 每天和你一起刷 LeetCode 每日一题~ LeetCode 启动! 题目:座位预约管理系统 代码与解题思路 type SeatManager struct {sort.IntSlice // 默认最小堆 }// 非常常规的一道堆的题目,建一个最小堆 func Constructor(n int) SeatManager …

Spring Mvc 基础源码分析

一、onRefresh 初始化 在 Spring MVC 中,onRefresh 是 FrameworkServlet 类中的一个关键方法,负责在 Spring Web 应用的容器刷新时,初始化与 Web 相关的组件,包括加载和配置 DispatcherServlet。这一过程是 Spring MVC 启动和运行…

【已解决】【Hadoop】找到java环境路径

在 Hadoop 环境中,Java 环境路径通常指的是 Java 的安装目录,因为 Hadoop 是用 Java 编写的,并且需要 Java 运行时环境(JRE)或 Java 开发工具(JDK)来运行。以下是几种方法来找到 Java 环境路径&…

go channel的使用

channel是goroutine之间通信的管道,可以将值从一个goroutine发送到channel,另一个goroutine从channel接收到这些值。 Do not communicate by sharing memory; instead, share memory by communicating. 创建channel //无缓存channel ch : make(chan int…