问题详情
使用apt-get update更新安装列表后,出现如下报错:
updates InRelease
Get:9 https://packages.gitlab.com/gitlab/gitlab-ce/ubuntu noble InRelease [16.9 kB]
Err:9 https://packages.gitlab.com/gitlab/gitlab-ce/ubuntu noble InRelease
The following signatures were invalid: EXPKEYSIG 3F01618A51312F3F GitLab B.V. (package repository signing key) <packages@gitlab.com>
Fetched 16.9 kB in 4s (4,813 B/s)
Reading package lists... Done
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-ce/ubuntu noble InRelease: The following signatures were invalid: EXPKEYSIG 3F01618A51312F3F GitLab B.V. (package repository signing key) <packages@gitlab.com>
W: Failed to fetch https://packages.gitlab.com/gitlab/gitlab-ce/ubuntu/dists/noble/InRelease The following signatures were invalid: EXPKEYSIG 3F01618A51312F3F GitLab B.V. (package repository signing key) <packages@gitlab.com>
W: Some index files failed to download. They have been ignored, or old ones used instead.
原因
这是因为在ubuntu源中配置的gitlab源的GPG密钥有效期过了,(密钥是有有效期的)。如果密钥过期,那么UBUNTU的APT包管理器就会拒绝该仓库的更新。当然,解决方案很简单,重新更新下gitlab仓库的GPG密钥即可。
解决方案
最简单的方案就是直接运行gitlab官方的一键安装脚本了
curl -s https://packages.gitlab.com/install/repositories/gitlab/gitlab-ce/script.deb.sh | sudo bash