deb https://mirrors.tuna.tsinghua.edu.cn/ubuntu/ bionic main restricted universe multiverse
# deb-src https://mirrors.tuna.tsinghua.edu.cn/ubuntu/ bionic main restricted universe multiverse
deb https://mirrors.tuna.tsinghua.edu.cn/ubuntu/ bionic-updates main restricted universe multiverse
# deb-src https://mirrors.tuna.tsinghua.edu.cn/ubuntu/ bionic-updates main restricted universe multiverse
deb https://mirrors.tuna.tsinghua.edu.cn/ubuntu/ bionic-backports main restricted universe multiverse
# deb-src https://mirrors.tuna.tsinghua.edu.cn/ubuntu/ bionic-backports main restricted universe multiverse
deb https://mirrors.tuna.tsinghua.edu.cn/ubuntu/ bionic-security main restricted universe multiverse
# deb-src https://mirrors.tuna.tsinghua.edu.cn/ubuntu/ bionic-security main restricted universe multiverse
通过sudo vim /etc/apt/sources.list 输入上述代码更换清华的镜像源,但在sudo apt-get update后出现以下报错
获取:1 https://mirrors.tuna.tsinghua.edu.cn/ubuntu bionic InRelease [242 kB]
命中:2 https://packages.microsoft.com/repos/code stable InRelease
获取:3 https://mirrors.tuna.tsinghua.edu.cn/ubuntu bionic-updates InRelease [102 kB]
错误:1 https://mirrors.tuna.tsinghua.edu.cn/ubuntu bionic InRelease
由于没有公钥,无法验证下列签名: NO_PUBKEY 3B4FE6ACC0B21F32
错误:3 https://mirrors.tuna.tsinghua.edu.cn/ubuntu bionic-updates InRelease
由于没有公钥,无法验证下列签名: NO_PUBKEY 3B4FE6ACC0B21F32
获取:4 https://mirrors.tuna.tsinghua.edu.cn/ubuntu bionic-backports InRelease [102 kB]
获取:5 https://mirrors.tuna.tsinghua.edu.cn/ubuntu bionic-security InRelease [102 kB]
错误:4 https://mirrors.tuna.tsinghua.edu.cn/ubuntu bionic-backports InRelease
由于没有公钥,无法验证下列签名: NO_PUBKEY 3B4FE6ACC0B21F32
错误:5 https://mirrors.tuna.tsinghua.edu.cn/ubuntu bionic-security InRelease
由于没有公钥,无法验证下列签名: NO_PUBKEY 3B4FE6ACC0B21F32
命中:6 https://ppa.launchpadcontent.net/ubuntu-toolchain-r/test/ubuntu jammy InRelease
正在读取软件包列表... 完成
W: GPG 错误:https://mirrors.tuna.tsinghua.edu.cn/ubuntu bionic InRelease: 由于没有公钥,无法验证下列签名: NO_PUBKEY 3B4FE6ACC0B21F32
E: 仓库 “https://mirrors.tuna.tsinghua.edu.cn/ubuntu bionic InRelease” 没有数字签名。
N: 无法安全地用该源进行更新,所以默认禁用该源。
N: 参见 apt-secure(8) 手册以了解仓库创建和用户配置方面的细节。
W: GPG 错误:https://mirrors.tuna.tsinghua.edu.cn/ubuntu bionic-updates InRelease: 由于没有公钥,无法验证下列签名: NO_PUBKEY 3B4FE6ACC0B21F32
E: 仓库 “https://mirrors.tuna.tsinghua.edu.cn/ubuntu bionic-updates InRelease” 没有数字签名。
N: 无法安全地用该源进行更新,所以默认禁用该源。
N: 参见 apt-secure(8) 手册以了解仓库创建和用户配置方面的细节。
W: GPG 错误:https://mirrors.tuna.tsinghua.edu.cn/ubuntu bionic-backports InRelease: 由于没有公钥,无法验证下列签名: NO_PUBKEY 3B4FE6ACC0B21F32
E: 仓库 “https://mirrors.tuna.tsinghua.edu.cn/ubuntu bionic-backports InRelease” 没有数字签名。
N: 无法安全地用该源进行更新,所以默认禁用该源。
N: 参见 apt-secure(8) 手册以了解仓库创建和用户配置方面的细节。
W: GPG 错误:https://mirrors.tuna.tsinghua.edu.cn/ubuntu bionic-security InRelease: 由于没有公钥,无法验证下列签名: NO_PUBKEY 3B4FE6ACC0B21F32
E: 仓库 “https://mirrors.tuna.tsinghua.edu.cn/ubuntu bionic-security InRelease” 没有数字签名。
N: 无法安全地用该源进行更新,所以默认禁用该源。
N: 参见 apt-secure(8) 手册以了解仓库创建和用户配置方面的细节。
通过指令 sudo apt-key adv --keyserver hkp://keyserver.ubuntu.com:80 --recv 3B4FE6ACC0B21F32 将76F1A20FF987672F替换为你报错中 NO_PUBKEY 后的ID 3B4FE6ACC0B21F32 输入运行sudo apt-get update即可正常