我按照这些说明docker
在 debian 9.11“stretch”上安装
https://docs.docker.com/engine/install/debian/
我的文件/etc/apt/sources.list
看起来像这样
deb http://repo.myloc.de/debian stretch main non-free contrib
deb-src http://repo.myloc.de/debian stretch main non-free contrib
deb http://repo.myloc.de/debian-security stretch/updates main
deb-src http://repo.myloc.de/debian-security stretch/updates main
deb http://repo.myloc.de/debian stretch-updates main
deb-src http://repo.myloc.de/debian stretch-updates main
deb https://download.docker.com/linux/debian stretch stable
#deb-src [arch=amd64] https://download.docker.com/linux/debian stretch stable
命令
curl -fsSL https://download.docker.com/linux/debian/gpg | apt-key add -
给出
OK
但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://get.docker.com/ubuntu docker Release: The following signatures were invalid: 36A1D7869245C8950F966E92D8576A8BA88D21E9
W: Failed to fetch https://get.docker.com/ubuntu/dists/docker/Release.gpg The following signatures were invalid: 36A1D7869245C8950F966E92D8576A8BA88D21E9
W: Some index files failed to download. They have been ignored, or old ones used instead.
我对那里的提及感到困惑ubuntu
,但可能没关系。
编辑:评论中要求的附加信息
> uname -a
Linux b028 4.9.0-12-amd64 #1 SMP Debian 4.9.210-1 (2020-01-20) x86_64 GNU/Linux
> grep ^deb /etc/apt/sources.list.d/*
/etc/apt/sources.list.d/docker.list:deb https://get.docker.com/ubuntu docker main
/etc/apt/sources.list.d/docker.list.save:deb https://get.docker.com/ubuntu docker main
/etc/apt/sources.list.d/nodesource.list:deb https://deb.nodesource.com/node_0.12 wheezy main
/etc/apt/sources.list.d/nodesource.list:deb-src https://deb.nodesource.com/node_0.12 wheezy main
/etc/apt/sources.list.d/nodesource.list.save:deb https://deb.nodesource.com/node_0.12 wheezy main
/etc/apt/sources.list.d/nodesource.list.save:deb-src https://deb.nodesource.com/node_0.12 wheezy main
该目录的内容sources.list.d
可能是错误的残余内容。也许,我必须删除它们。
答案1
是的,您需要删除下面的 docker 存储库/etc/apt/sources.list.d/
(这不是有效的 docker 存储库,它是 docker 安装脚本的 url):
sudo rm /etc/apt/sources.list.d/docker.list{,.save}
然后编辑你的sources.list
:
sudo apt edit-sources
更改以下行:
deb https://download.docker.com/linux/debian stretch stable
到
deb [arch=amd64] https://download.docker.com/linux/debian stretch stable
然后运行:
sudo apt update
sudo apt install docker-ce