How to renew expired GPG key (EXPKEYSIG 3F01618A51312F3F) for GitLab APT repositories

Written by - 3 comments

Published on - Listed in Linux Git


It seems that the GPG key used for signing the deb packages in the GitLab repositories has expired:

root@gitlab:~# apt-get update
Hit:1 http://security.debian.org/debian-security buster/updates InRelease
Hit:2 http://deb.debian.org/debian buster InRelease
Get:3 https://packages.gitlab.com/gitlab/gitlab-ce/debian buster InRelease [23.3 kB]
Err:3 https://packages.gitlab.com/gitlab/gitlab-ce/debian buster InRelease
  The following signatures were invalid: EXPKEYSIG 3F01618A51312F3F GitLab B.V. (package repository signing key) <packages@gitlab.com>

Fetched 23.3 kB in 1s (21.0 kB/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/debian buster 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/debian/dists/buster/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.

The repository instructions contain a shell script which also installs the (new) key, but you probably don't want to start your car just to cross the street. Simply use the following command to install the new key:

root@gitlab:~# curl -s https://packages.gitlab.com/gpg.key | apt-key add -
OK

And voilĂ , apt is happy again:

root@gitlab:~# apt-get update
Hit:1 http://security.debian.org/debian-security buster/updates InRelease
Hit:2 http://deb.debian.org/debian buster InRelease
Get:3 https://packages.gitlab.com/gitlab/gitlab-ce/debian buster InRelease [23.3 kB]
Get:4 https://packages.gitlab.com/gitlab/gitlab-ce/debian buster/main amd64 Packages [44.3 kB]
Fetched 67.6 kB in 2s (31.3 kB/s)
Reading package lists... Done



Add a comment

Show form to leave a comment

Comments (newest first)

Kris from wrote on Feb 15th, 2023:

Worked like a charm,thanks!


Dominic from wrote on Feb 7th, 2023:

Just wanted to say thank you for this. You saved me some time today. :)


Ioan from Germany wrote on May 4th, 2022:

This worked. Thank you.