GPG error: https://download.docker.com/linux/ubuntu bionic InRelease: The following signatures could

本文介绍了在Ubuntu系统中更新Docker时遭遇GPG错误,特别是NO_PUBKEY问题的详细解决步骤。首先通过curl和gpg命令添加缺失的docker公钥,然后调整权限,最后成功执行apt update。参考了StackOverflow和CSDN博主的建议。

摘要生成于 C知道 ,由 DeepSeek-R1 满血版支持, 前往体验 >

问题: 

sudo apt update

报错 :

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

一般遇到NO_PUBKEY只需要添加这个key就行:

sudo apt-key adv --keyserver keyserver.ubuntu.com --recv-keys 7EA0A9C3F273FCD8

但是对于这个docker的key却不行。

解决办法

First, add key to /usr/share/keyrings/docker-archive-keyring.gpg by command:

sudo curl -fsSL "https://download.docker.com/linux/ubuntu/gpg" | sudo gpg --dearmor --yes -o /usr/share/keyrings/docker-archive-keyring.gpg

PS For some the part gpgp --dearmor was useful.

Second, update permissions for it:

sudo chmod a+r /usr/share/keyrings/docker-archive-keyring.gpg

Then,

sudo apt update

参考:

Docker: How to solve the public key error in ubuntu while installing docker - Stack Overflow

解决GPG error: The following signatures couldn't be verified because the public key is not available_追求卓越583的博客-CSDN博客

sudo apt update && sudo apt install -y apt-transport-https ca-certificates curl gnupg2 software-properties-common Hit:1 https://mirrors.aliyun.com/debian bookworm InRelease Ign:2 https://download.docker.com/linux/debian bookworm InRelease Hit:3 https://mirrors.aliyun.com/debian-security bookworm-security InRelease Hit:4 https://mirrors.aliyun.com/debian bookworm-updates InRelease Hit:5 https://mirrors.aliyun.com/debian bookworm-backports InRelease Ign:2 https://download.docker.com/linux/debian bookworm InRelease Ign:2 https://download.docker.com/linux/debian bookworm InRelease Hit:2 https://download.docker.com/linux/debian bookworm InRelease Err:2 https://download.docker.com/linux/debian bookworm InRelease The following signatures couldn't be verified because the public key is not available: NO_PUBKEY 7EA0A9C3F273FCD8 Reading package lists... Done Building dependency tree... Done Reading state information... Done All packages are up to date. W: An error occurred during the signature verification. The repository is not updated and the previous index files will be used. GPG error: https://download.docker.com/linux/debian bookworm InRelease: The following signatures couldn't be verified because the public key is not available: NO_PUBKEY 7EA0A9C3F273FCD8 W: Failed to fetch https://download.docker.com/linux/debian/dists/bookworm/InRelease The following signatures couldn't be verified because the public key is not available: NO_PUBKEY 7EA0A9C3F273FCD8 W: Some index files failed to download. They have been ignored, or old ones used instead. W: Target Packages (stable/binary-amd64/Packages) is configured multiple times in /etc/apt/sources.list.d/archive_uri-https_download_docker_com_linux_debian-bookworm.list:1 and /etc/apt/sources.list.d/docker.list:1 W: Target Packages (stable/binary-all/Packages) is configured multiple times in /etc/apt/sources.list.d/archive_uri-https_download_docker_com_linux_debian-bookworm.list:1 and /etc/apt/sources.list.d/docker.list:1
03-12
评论 4
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值