2 partake2012 partake2012 于 2017.04.19 15:54 提问

docker ce 注册apt源时遇到问题

今天尝试安装docker最新社区版,在注册官方安装源的时候遇到问题。

按官方文档所述,已经安装好apt的https模块,下载并验证了证书。执行如下语句注册官方源

sudo add-apt-repository \
"deb [arch=amd64] https://download.docker.com/linux/ubuntu \
$(lsb_release -cs) \
stable"

执行后,/etc/apt/source.list如下:

……
deb [arch=amd64] https://download.docker.com/linux/ubuntu trusty stable
# deb-src [arch=amd64] https://download.docker.com/linux/ubuntu trusty stable
……

此时执行更新命令apt-get update,报如下异常

……
Ign https://download.docker.com trusty InRelease

Ign https://download.docker.com trusty Release.gpg
Ign https://download.docker.com trusty Release
Err https://download.docker.com trusty/stable amd64 Packages
Bad header line
Ign https://download.docker.com trusty/stable Translation-en_US
Ign https://download.docker.com trusty/stable Translation-en
Fetched 68.8 MB in 2min 0s (574 kB/s)
W: Failed to fetch https://download.docker.com/linux/ubuntu/dists/trusty/stable/binary-amd64/Packages Bad header line
E: Some index files failed to download. They have been ignored, or old ones used instead.

清除缓存(rm -Rf /var/lib/apt/lists/*)后再次执行更新依然是上述异常。

谁有过类似问题解决经历或者解决思路,请不吝赐教!

1个回答

partake2012
partake2012   2017.04.21 09:47
已采纳

貌似原因是部分链接在大陆无法访问,但具体是哪些我没有亲自试。目前解决办法是直接下载安装包进行安装。如果哪位同学找到更好的解决办法,也请说一下。

Csdn user default icon
上传中...
上传图片
插入图片