问题描述
博主为了安装docker,使用apt-key add
添加了GPG key,然后又add-apt-repository
创建了repository。后面发现这个安装方法行不通,就用apt-key del
删除了key,但是之后使用apt update
发现如下提示:
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.coied because the public key is not available: NO_PUBKEY 7EA0A9C3F273FCD8
W: Failed to fetch https://download.docker.com/linux/ubuntu/dists/bionic/InRelease The following signatures couldn’t be verified because the public key is not availa
W: Some index files failed to download. They have been ignored, or old ones used instead.
问题原因
因为已经建立repository,如果只删除key会使得该repository无法验证key,所以如果需要删除则要key和repository全部删除
问题解决
vim /etc/apt/sources.list
- 找到多余的deb和deb-src,删除该行保存文件
- 重新
apt update
问题解决