树莓派更换国源后执行sudo apt update后报错:
The following signatures couldn’t be verified because the public key is not available: NO_PUBKEY 9165938D90FDDD2E
Reading package lists… Done
W: GPG error: http://mirrors.aliyun.com/raspbian/raspbian buster InRelease: The following signatures couldn’t be verified because the public key is not available: NO_PUBKEY 9165938D90FDDD2E
E: The repository ‘http://mirrors.aliyun.com/raspbian/raspbian buster 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.
翻译一下是:
The following signatures couldn’t be verified because the public key is not available: NO_PUBKEY 9165938D90FDDD2E
这表示APT在尝试验证软件包的签名时,没有找到对应的公钥。APT使用公钥来确保软件包的来源是可信的,防止恶意软件包被安装。NO_PUBKEY 9165938D90FDDD2E是缺失公钥的标识符。
Reading package lists… Done
这表示APT已经完成了软件包列表的读取。
W: GPG error: http://mirrors.aliyun.com/raspbian/raspbian buster InRelease: The following signatures couldn’t be verified because the public key is not available: NO_PUBKEY 9165938D90FDDD2E
这是一个警告(由W:表示),指出在使用GPG(GNU Privacy Guard,一种加密软件)进行签名验证时出现了错误。具体来说,是因为无法验证http://mirrors.aliyun.com/raspbian/raspbian源的InRelease文件的签名,原因是缺少公钥。
E: The repository ‘http://mirrors.aliyun.com/raspbian/raspbian buster InRelease’ is not signed.
这是一个错误(由E:表示),说明APT无法验证指定的软件源的签名,因为它没有被正确签名。
N: Updating from such a repository can’t be done securely, and is therefore disabled by default.
这是一个通知,说明由于无法安全地验证软件源的签名,APT默认禁止从该源更新软件包。
N: See apt-secure(8) manpage for repository creation and user configuration details.
这是一个通知,建议用户查看apt-secure(8)的手册页,以获取有关如何安全地创建和配置软件源的详细信息。
解决方法:
执行一下命令即可
sudo apt-key adv --keyserver keyserver.ubuntu.com --recv-keys 9165938D90FDDD2E