# sudo apt-get update
发生异常
Hit:1 http://mirrors.cloud.aliyuncs.com/ubuntu bionic InRelease
Hit:2 http://mirrors.cloud.aliyuncs.com/ubuntu bionic-updates InRelease
Hit:3 http://mirrors.cloud.aliyuncs.com/ubuntu bionic-security InRelease
Get:4 https://packages.gitlab.com/runner/gitlab-runner/ubuntu bionic InRelease [23.5 kB]
Err:4 https://packages.gitlab.com/runner/gitlab-runner/ubuntu bionic 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 bionic 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 bionic 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
解决:
直接执行如下命令,比如我没有 3F01618A51312F3F,就需要执行
# sudo apt-key adv --keyserver keyserver.ubuntu.com --recv-keys 3F01618A51312F3F
Executing: /tmp/apt-key-gpghome.dOCPRYVKxF/gpg.1.sh --keyserver keyserver.ubuntu.com --recv-keys 3F01618A51312F3F
gpg: key 3F01618A51312F3F: public key "GitLab B.V. (package repository signing key) <packages@gitlab.com>" imported
gpg: Total number processed: 1
gpg: imported: 1
# sudo apt-get update
Hit:1 http://mirrors.cloud.aliyuncs.com/ubuntu bionic InRelease
Hit:2 http://mirrors.cloud.aliyuncs.com/ubuntu bionic-updates InRelease
Hit:3 http://mirrors.cloud.aliyuncs.com/ubuntu bionic-security InRelease
Get:4 https://packages.gitlab.com/runner/gitlab-runner/ubuntu bionic InRelease [23.5 kB]
Ign:5 https://packages.gitlab.com/runner/gitlab-runner/ubuntu bionic/main amd64 Packages
Get:6 https://packages.gitlab.com/runner/gitlab-runner/ubuntu bionic/main i386 Packages [17.4 kB]
Get:5 https://packages.gitlab.com/runner/gitlab-runner/ubuntu bionic/main amd64 Packages [17.6 kB]
Fetched 58.4 kB in 8s (7,566 B/s)
Reading package lists... Done