将系统从 ubuntu 20.04(focal) 升级至 ubuntu 22.04(jammy) 后,将 /etc/apt/sources.list.d/runner_gitlab-runner.list 中的 focal 改为 jammy
deb [signed-by=/usr/share/keyrings/runner_gitlab-runner-archive-keyring.gpg] https://packages.gitlab.com/runner/gitlab-runner/ubuntu/ jammy main
deb-src [signed-by=/usr/share/keyrings/runner_gitlab-runner-archive-keyring.gpg] https://packages.gitlab.com/runner/gitlab-runner/ubuntu/ jammy main
运行 apt update 时报错
Err:6 https://packages.gitlab.com/runner/gitlab-runner/ubuntu jammy InRelease
The following signatures couldn't be verified because the public key is not available: NO_PUBKEY 3F01618A51312F3F
Reading package lists... Done
W: GPG error: https://packages.gitlab.com/runner/gitlab-runner/ubuntu jammy InRelease: The following signatures couldn't be verified because the public key is not available: NO_PUBKEY 3F01618A51312F3F
E: The repository 'https://packages.gitlab.com/runner/gitlab-runner/ubuntu jammy 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.
通过下面的命令安装 key,问题依旧
curl -s https://packages.gitlab.com/gpg.key | apt-key add -
通过下面的命令安装 gpg key 解决了
curl -fsSL https://packages.gitlab.com/runner/gitlab-runner/gpgkey \
| gpg --dearmor > /usr/share/keyrings/runner_gitlab-runner-archive-keyring.gpg