apt Update Error

apt Update Error

apt Update Error
Page content

apt update error

error

root@[09:48:18]suosuoli:[/etc/apt]
# apt update
...
# 有两个公钥丢失
W: GPG error: http://mirrors.aliyun.com/ubuntu focal InRelease: The following signatures couldn't be verified because the public key is not available: NO_PUBKEY 3B4FE6ACC0B21F32 NO_PUBKEY 871920D1991BC93C
E: The repository 'http://mirrors.aliyun.com/ubuntu focal 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.
...

solution

root@[09:49:18]suosuoli:[/etc/apt]
# 使用apt-key工具重服务器获取公钥
# apt-key adv --keyserver hkp://keyserver.ubuntu.com:80 --recv-keys 3B4FE6ACC0B21F32 871920D1991BC93C
Executing: /tmp/apt-key-gpghome.HeTpji4ivH/gpg.1.sh --keyserver hkp://keyserver.ubuntu.com:80 --recv-keys 3B4FE6ACC0B21F32 871920D1991BC93C
gpg: key 871920D1991BC93C: "Ubuntu Archive Automatic Signing Key (2018) <ftpmaster@ubuntu.com>" not changed
gpg: key 3B4FE6ACC0B21F32: "Ubuntu Archive Automatic Signing Key (2012) <ftpmaster@ubuntu.com>" not changed
gpg: Total number processed: 2
gpg:              unchanged: 2