【问题标题】:The following signatures couldn't be verified because the public key is not available: NO_PUBKEY 871920D1991BC93C由于公钥不可用,无法验证以下签名:NO_PUBKEY 871920D1991BC93C
【发布时间】:2022-10-05 15:08:42
【问题描述】:

我正在尝试在 Docker 中使用 Ubuntu 20 或 Ubuntu 22。我的Dockerfile 是:

from ubuntu:22.04
run DEBIAN_FRONTEND=noninteractive apt update

我用docker build . 构建它。结果是:

Sending build context to Docker daemon  2.048kB
Step 1/2 : from ubuntu:22.04
---> 2dc39ba059dc
Step 2/2 : run DEBIAN_FRONTEND=noninteractive apt update
---> Running in b15002ae9dd5

WARNING: apt does not have a stable CLI interface. Use with caution in scripts.
Get:1 http://archive.ubuntu.com/ubuntu jammy InRelease [270 kB] 
Get:2 http://security.ubuntu.com/ubuntu jammy-security 
InRelease [110 kB] 
Get:3 http://archive.ubuntu.com/ubuntu jammy-updates InRelease [114 kB] 
Get:4 http://archive.ubuntu.com/ubuntu jammy-backports InRelease [99.8 kB] Err:1 http://archive.ubuntu.com/ubuntu jammy InRelease   
The following signatures couldn\'t be verified because the public key is not available: NO_PUBKEY 871920D1991BC93C 

我多次收到此消息,直到我得到:

W: http://archive.ubuntu.com/ubuntu/dists/jammy/InRelease: The key(s) in the keyring /etc/apt/trusted.gpg.d/ubuntu-keyring-2012-cdimage.gpg are ignored as the file is not readable by user \'_apt\' executing apt-key.

我曾尝试将chmod a+rwx /etc/apt -R 作为Dockerfile 中的第一个run 命令,但没有任何区别。

我还明确运行了docker pull ubuntu:22.04,它说它已经是最新的了。我对ubuntu:20.04 图像有完全相同的问题。

我已经咨询了所有其他有关此问题的网络资源,但它们都要求我能够运行 apt install apt-key 或其他东西,但我无法更新 apt 以开始,所以除了前 3 个之外没有任何效果搜索引擎点击页面只是展示了如何在 Ubuntu 上安装 Docker,而不是相反。

如另一个答案中所述,我也尝试过--security-opt seccomp:unconfined。回复Error response from daemon: The daemon on this platform does not support setting security options on build

所以我的图像没有curlwgetgnupg,如果不让它工作,我就无法安装它。当我对apt-key 做任何事情时,我得到:E: gnupg, gnupg2 and gnupg1 do not seem to be installed, but one of them is required for this operation

我已经设法从 deb 文件手动安装gnupg,并手动接收密钥,这会给出类似的错误消息:

# apt-key adv --keyserver keyserver.ubuntu.com --recv-keys 871920D1991BC93C
Warning: apt-key is deprecated. Manage keyring files in trusted.gpg.d instead (see apt-key(8)).
Executing: /tmp/apt-key-gpghome.rQuYmKpjpo/gpg.1.sh --keyserver keyserver.ubuntu.com --recv-keys 871920D1991BC93C
gpg: requesting key 991BC93C from hkp server keyserver.ubuntu.com
gpg: key 991BC93C: public key \"Ubuntu Archive Automatic Signing Key (2018) <ftpmaster@ubuntu.com>\" imported
gpg: Total number processed: 1
gpg:               imported: 1  (RSA:  1)
W: The key(s) in the keyring /etc/apt/trusted.gpg.d/ubuntu-keyring-2018-archive.gpg are ignored as the file is not readable by user \'\' executing apt-key.

我还尝试将/etc/apt/source.list 缩减到最低限度。同样的问题。

如何从主机添加所需的密钥?

作为次要问题,这样的主流工具和发行版如何被打破?是否每个人都转向了其他事情,它是什么?我没有良好的互联网接入,因此及时了解计算机世界正在发生的事情是一个挑战。

  • 这不是真正的编程或代码相关问题,而是应该在Ask Ubuntu 上。
  • 我该如何移动它?这是用于编程的,因为它是我需要编译其他东西的基础,我不确定它是 docker 还是 Debian 问题?
  • Askubuntu 还说我必须等待 40 分钟才能发布它,它还说我没有足够的声誉来添加标签。你会好心把它搬走吗?
  • 曾经解决过这个问题吗?出于同样的原因,我似乎也无法在 ubuntu 20.04 上安装 docker。

标签: docker ubuntu gnupg apt apt-key


【解决方案1】:

只需升级主机上的 docker。 https://docs.docker.com/engine/install/ubuntu/

这是用于保护密钥的新系统调用的罕见不兼容,旧 Docker 不支持。没有办法给 Ubuntu 打补丁以在旧 Docker 上工作,我花了半天时间尝试。

【讨论】:

  • 回答时要有礼貌,不要使用感叹号和大写句子。此外,更详细地解释需要做什么。单行答案永远不是一个好的选择
猜你喜欢
  • 2021-04-12
  • 1970-01-01
  • 2022-11-25
  • 2020-01-19
  • 2022-07-17
  • 2013-05-28
  • 1970-01-01
  • 1970-01-01
  • 2012-07-26
相关资源
最近更新 更多