大网数据广告活动
服务器运维问答

Gitlab Debian Repository Public Key is Not Available

· 52CE 我爱测

When running 'sudo apt update' I get the following error: user@gitlab:~$ sudo apt update Hit:1 http://security.debian.org/debian-security stretch/updates InRelease Ign:2 http://ftp.fi.debian.org/debian stretch InRelease Hit:3 htt…

问题原文

原帖链接 · Stuggi · CC BY-SA 4.0

When running 'sudo apt update' I get the following error:

user@gitlab:~$ sudo apt update
Hit:1 http://security.debian.org/debian-security stretch/updates InRelease
Ign:2 http://ftp.fi.debian.org/debian stretch InRelease
Hit:3 http://ftp.fi.debian.org/debian stretch-updates InRelease
Hit:4 http://ftp.fi.debian.org/debian stretch Release
Get:6 https://packages.gitlab.com/gitlab/gitlab-ee/debian stretch InRelease [23.3 kB]
Err:6 https://packages.gitlab.com/gitlab/gitlab-ee/debian stretch InRelease
  The following signatures couldn't be verified because the public key is not available: NO_PUBKEY 3F01618A51312F3F
Fetched 23.3 kB in 2s (11.0 kB/s)
Reading package lists... Done
Building dependency tree
Reading state information... Done
All packages are up to date.
W: An error occurred during the signature verification. The repository is not updated and the previous index files will be used. GPG error: https://packages.gitlab.com/gitlab/gitlab-ee/debian stretch InRelease: The following signatures couldn't be verified because the public key is not available: NO_PUBKEY 3F01618A51312F3F
W: Failed to fetch https://packages.gitlab.com/gitlab/gitlab-ee/debian/dists/stretch/InRelease  The following signatures couldn't be verified because the public key is not available: NO_PUBKEY 3F01618A51312F3F
W: Some index files failed to download. They have been ignored, or old ones used instead.

已采纳解答

原帖链接 · Stuggi · CC BY-SA 4.0

The problem is that the key installed by the Gitlab installation script has expired. This can be verified by running sudo apt-key list

user@gitlab:~$ sudo apt-key list
/etc/apt/trusted.gpg
--------------------
pub   rsa4096 2015-04-17 [SC] [expired: 2020-04-15]
      1A4C 919D B987 D435 9396  38B9 1421 9A96 E15E 78F4
uid           [ expired] GitLab B.V. (package repository signing key) <[email omitted]>
-------Output Snipped----------

This is easily fixed by running the same command that the Gitlab installation script runs, which will fetch the new key from Gitlab and install it in the APT keyring.

curl -L "https://packages.gitlab.com/gitlab/gitlab-ce/gpgkey" 2> /dev/null | sudo apt-key add - &>/dev/null

After this, the apt-key list command can be rerun to verify that the key was installed properly.

user@gitlab:~$ sudo apt-key list
/etc/apt/trusted.gpg
--------------------
pub   rsa4096 2015-04-17 [SC] [expired: 2020-04-15]
      1A4C 919D B987 D435 9396  38B9 1421 9A96 E15E 78F4
uid           [ expired] GitLab B.V. (package repository signing key) <[email omitted]>

pub   rsa4096 2020-03-02 [SC] [expires: 2022-03-02]
      F640 3F65 44A3 8863 DAA0  B6E0 3F01 618A 5131 2F3F
uid           [ unknown] GitLab B.V. (package repository signing key) <[email omitted]>
sub   rsa4096 2020-03-02 [E] [expires: 2022-03-02]

摘自公开归档,保留原文语言,版式经整理,外部媒体与邮箱地址已移除。

资料来源与适用范围

资料来源
Server Fault
适用范围
以原帖系统、软件版本与发布日期为准(2020-05-02)
内容语言
中文;命令、路径和错误标识保留技术原文
本地收录日期
2026-11-15
授权说明
CC BY-SA 4.0

正文与所需资源由本站本地存储。查看来源及更新记录 ↗

请按适用版本和实际日志确认原因;本站没有对每一种系统或设备逐项执行文中的操作。