简介
本文介绍用Ubuntu的apt-get update命令时提示签名无法认证的问题。
问题描述
在Ubuntu下执行sudo apt-get update时出现了如下报错:
The following signatures couldn't be verified because the public key is not available: NO_PUBKEY A7813D884I98HR43 Reading package lists... Done W: GPG error: https://download.docker.com/linux/ubuntu bionic InRelease: The following signatures couldn't be verified because the public key is not available: NO_PUBKEY A7813D884I98HR43 E: The repository 'https://download.docker.com/linux/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.
原因分析
此服务器缺少这个公钥。
解决方案
将此公钥添加到本台服务器即可,命令如下(此命令大概要执行十几秒):
sudo apt-key adv --keyserver keyserver.ubuntu.com --recv-keys A7813D884I98HR43
注意:最后的字符串要换成报错中提示出来的那个字符串。
请先
!