jenkins APT-GET docker容器上的GPG错误(Ubuntu 22.04)[已关闭]

72qzrwbm  于 2023-04-11  发布在  Jenkins
关注(0)|答案(1)|浏览(234)

**已关闭。**此问题为not about programming or software development。当前不接受答案。

此问题似乎与a specific programming problem, a software algorithm, or software tools primarily used by programmers无关。如果您认为此问题与another Stack Exchange site主题相关,您可以留下评论以解释在何处可以回答此问题。
2小时前关闭
Improve this question
我尝试在一个ubuntu:22.04 docker容器上只运行apt-get update。在我的本地机器上,当我启动一个新的ubuntu:22.04 docker容器和run apt-get update时,没有错误发生。然而,在我的Jenkins管道上,我得到了这样的结果:

09:37:57  + apt-get update --allow-insecure-repositories
09:37:58  Get:1 http://archive.ubuntu.com/ubuntu jammy InRelease [270 kB]
09:37:58  Get:2 http://security.ubuntu.com/ubuntu jammy-security InRelease [110 kB]
09:37:58  Ign:2 http://security.ubuntu.com/ubuntu jammy-security InRelease
09:37:58  Get:3 http://security.ubuntu.com/ubuntu jammy-security/multiverse amd64 Packages [23.2 kB]
09:37:59  Get:4 http://archive.ubuntu.com/ubuntu jammy-updates InRelease [119 kB]
09:37:59  Ign:1 http://archive.ubuntu.com/ubuntu jammy InRelease
09:37:59  Get:5 http://security.ubuntu.com/ubuntu jammy-security/universe amd64 Packages [909 kB]
09:37:59  Ign:4 http://archive.ubuntu.com/ubuntu jammy-updates InRelease
09:37:59  Get:6 http://archive.ubuntu.com/ubuntu jammy-backports InRelease [108 kB]
09:37:59  Ign:6 http://archive.ubuntu.com/ubuntu jammy-backports InRelease
09:37:59  Get:7 http://archive.ubuntu.com/ubuntu jammy/universe amd64 Packages [17.5 MB]
09:38:00  Get:8 http://security.ubuntu.com/ubuntu jammy-security/main amd64 Packages [914 kB]
09:38:00  Get:9 http://security.ubuntu.com/ubuntu jammy-security/restricted amd64 Packages [908 kB]
09:38:01  Get:10 http://archive.ubuntu.com/ubuntu jammy/restricted amd64 Packages [164 kB]
09:38:01  Get:11 http://archive.ubuntu.com/ubuntu jammy/multiverse amd64 Packages [266 kB]
09:38:01  Get:12 http://archive.ubuntu.com/ubuntu jammy/main amd64 Packages [1792 kB]
09:38:01  Get:13 http://archive.ubuntu.com/ubuntu jammy-updates/main amd64 Packages [1251 kB]
09:38:01  Get:14 http://archive.ubuntu.com/ubuntu jammy-updates/multiverse amd64 Packages [28.6 kB]
09:38:01  Get:15 http://archive.ubuntu.com/ubuntu jammy-updates/restricted amd64 Packages [963 kB]
09:38:01  Get:16 http://archive.ubuntu.com/ubuntu jammy-updates/universe amd64 Packages [1149 kB]
09:38:01  Get:17 http://archive.ubuntu.com/ubuntu jammy-backports/universe amd64 Packages [23.3 kB]
09:38:02  Get:18 http://archive.ubuntu.com/ubuntu jammy-backports/main amd64 Packages [49.0 kB]
09:38:02  Fetched 26.5 MB in 4s (6052 kB/s)
09:38:03  Reading package lists...
09:38:03  W: http://security.ubuntu.com/ubuntu/dists/jammy-security/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.
09:38:03  W: http://security.ubuntu.com/ubuntu/dists/jammy-security/InRelease: 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 '_apt' executing apt-key.
09:38:03  W: GPG error: http://security.ubuntu.com/ubuntu jammy-security InRelease: The following signatures couldn't be verified because the public key is not available: NO_PUBKEY 871920D1991BC93C
09:38:03  W: The repository 'http://security.ubuntu.com/ubuntu jammy-security InRelease' is not signed.
09:38:03  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.
09:38:03  W: http://archive.ubuntu.com/ubuntu/dists/jammy/InRelease: 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 '_apt' executing apt-key.
09:38:03  W: GPG error: http://archive.ubuntu.com/ubuntu jammy InRelease: The following signatures couldn't be verified because the public key is not available: NO_PUBKEY 871920D1991BC93C
09:38:03  W: The repository 'http://archive.ubuntu.com/ubuntu jammy InRelease' is not signed.
09:38:03  W: http://archive.ubuntu.com/ubuntu/dists/jammy-updates/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.
09:38:03  W: http://archive.ubuntu.com/ubuntu/dists/jammy-updates/InRelease: 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 '_apt' executing apt-key.
09:38:03  W: GPG error: http://archive.ubuntu.com/ubuntu jammy-updates InRelease: The following signatures couldn't be verified because the public key is not available: NO_PUBKEY 871920D1991BC93C
09:38:03  W: The repository 'http://archive.ubuntu.com/ubuntu jammy-updates InRelease' is not signed.
09:38:03  W: http://archive.ubuntu.com/ubuntu/dists/jammy-backports/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.
09:38:03  W: http://archive.ubuntu.com/ubuntu/dists/jammy-backports/InRelease: 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 '_apt' executing apt-key.
09:38:03  W: GPG error: http://archive.ubuntu.com/ubuntu jammy-backports InRelease: The following signatures couldn't be verified because the public key is not available: NO_PUBKEY 871920D1991BC93C
09:38:03  W: The repository 'http://archive.ubuntu.com/ubuntu jammy-backports InRelease' is not signed.
09:38:03  E: Problem executing scripts APT::Update::Post-Invoke 'rm -f /var/cache/apt/archives/*.deb /var/cache/apt/archives/partial/*.deb /var/cache/apt/*.bin || true'

如果他们使用相同的新容器,为什么这不起作用?我甚至添加了--allow-insecure-repositories,那么为什么它要验证密钥?最后,我在网上看到一些方法,我可以用curl命令添加密钥。问题是......因为这个容器是全新的,curl没有安装。这变成了一个鸡和蛋的问题,我不能在没有curl的情况下 curl 键,我不能在没有键的情况下安装curl。
谢谢!

vuv7lop3

vuv7lop31#

如果他们使用相同的新容器,为什么这不起作用?
要回答此问题,需要阅读并理解错误消息。
我甚至还添加了--allow-insecure-repositories,那么它为什么要验证密钥呢?
因为那些不是不安全的仓库。
最后,我在网上看到一些方法,我可以用curl命令添加键。问题是......因为这个容器是全新的,curl没有安装。这就变成了一个鸡和蛋的问题,没有curl就不能 curl 键,没有键就不能安装curl。
这又回到了您的第一个问题,同样,这需要阅读和理解错误消息。
如果这超出了您的支付等级,请咨询您正在构建的映像的供应商以获得支持选项。

相关问题