我正在尝试运行 apt-get update 并为 gitlab-runner 收到此错误:
# apt-get update
.
.
.
Get:6 https://packages.gitlab.com/runner/gitlab-runner/ubuntu focal InRelease [23.5 kB]
Err:6 https://packages.gitlab.com/runner/gitlab-runner/ubuntu focal InRelease
The following signatures were invalid: EXPKEYSIG 3F01618A51312F3F GitLab B.V. (package repository signing key) <[email protected]>
Reading package lists... Done
W: GPG error: https://packages.gitlab.com/runner/gitlab-runner/ubuntu focal InRelease: The following signatures were invalid: EXPKEYSIG 3F01618A51312F3F GitLab B.V. (package repository signing key) <[email protected]>
E: The repository 'https://packages.gitlab.com/runner/gitlab-runner/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.
You have new mail in /var/mail/root
#
.
.
.
我已经完成了一些关于这个完全相同的错误的帖子,但没有任何建议可以解决我的问题。
https://docs.gitlab.com/omnibus/update/package_signatures.html#package-repository-metadata-signing-keys上的官方 GitLab 签名密钥指南无法解决该问题。
上面的页面建议:
awk '/deb \[signed-by=/{
pubkey = $2;
sub(/\[signed-by=/, "", pubkey);
sub(/\]$/, "", pubkey);
print pubkey
}' /etc/apt/sources.list.d/gitlab_gitlab-?e.list | \
while read line; do
curl -s "https://packages.gitlab.com/gpg.key" | gpg --dearmor > $line
done
或者
apt-key del 3F01618A51312F3F
curl -s "https://packages.gitlab.com/gpg.key" | apt-key add -
apt-key list 3F01618A51312F3F
解决 gitlab-runner 的包存储库签名密钥已过期的问题,但错误仍然完全相同:
W: GPG error: https://packages.gitlab.com/runner/gitlab-runner/ubuntu focal InRelease: The following signatures were invalid: EXPKEYSIG 3F01618A51312F3F GitLab B.V. (package repository signing key) <[email protected]>
我还尝试了此处和其他地方找到的许多帖子中的步骤来更新存储库签名密钥,但没有任何效果 - 错误仍然相同。
这似乎是一个简单的操作 - 更新 APT 存储库的存储库签名密钥 - 但我究竟该如何执行此操作才能使 gitlab-runner 再次在 Ubuntu 20.04.6 LTS 中可更新和可维护?
这把钥匙
https://packages.gitlab.com/gpg.key
无论我做什么,gitlab-runner APT 存储库的“apt-get update”命令都认为它无效。
有任何想法吗?
谢谢!
(PS - 意识到“apt-key”已被弃用,但我只需要再次更新/可更新 gitlab-runner,现在不介意“apt-key”已被弃用。更新 gitlab-runner 后,我可以花时间学习如何使用 gpg 本身而不是 apt-key 来应对将来的签名到期。)