当添加新的源后,进行apt-get update后,可能会出现以下问题:

Get:5 http://xxxxxx

Err:5 http://xxxxxx

The following signatures couldn't be verified because the public key is not available: NO_PUBKEY xxxxxxxx('公钥编码')

并且伴随出现

E: The repository 'http://xxxxxx‘ 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.

解决办法:
将公钥添加至服务器,即终端中输入

apt-key adv --keyserver keyserver.ubuntu.com --recv-keys '公钥编码'

添加成功后终端输出为

gpg: key '公钥编码': public key "xxxxxx" imported
gpg: Total number processed: 1
gpg:                        imported: 1

祝各位好运!

最后修改:2022 年 01 月 06 日 10 : 47 AM
如果觉得我的文章对你有用,无需赞赏用心感谢!