服务器系统版本:Ubuntu Server 18.04.1 LTS 64bit
在安装docker时,进行到使用命令:
sudo apt-get update
这一步骤时出现
Hit:1 http://mirrors.tencentyun.com/ubuntu bionic InRelease
Hit:2 http://mirrors.tencentyun.com/ubuntu bionic-security InRelease
Hit:3 http://mirrors.tencentyun.com/ubuntu bionic-updates InRelease
Get:4 https://download.docker.com/linux/ubuntu bionic InRelease [64.4 kB]
Err:4 https://download.docker.com/linux/ubuntu bionic InRelease
The following signatures couldn't be verified because the public key is not available: NO_PUBKEY 7EA0A9C3F273FCD8
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 7EA0A9C3F273FCD8
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 chmod a+r /etc/apt/keyrings/docker.gpg
sudo apt-get update
不能解决问题
sudo chmod 755 /etc/apt/keyrings
sudo chmod a+r /etc/apt/keyrings/docker.gpg