无法在Ubuntu服务器上安装Docker

时间:2018-07-09 07:39:33

标签: ubuntu-16.04 docker-machine

我无法在Ubuntu服务器上安装Docker。

错误:

1.Failed to fetch https://download.docker.com/linux/ubuntu/dists/xenial/InRelease Unable to find expected entry 'stable/source/Sources' in Release file (Wrong sources.list entry or malformed file)
2.Failed to fetch http://ppa.launchpad.net/spring/ppa/ubuntu/dists/xenial/main/binary-amd64/Packages 404 Not Found  
3.Some index files failed to download. They have been ignored, or old ones used instead.

我的sources.list文件如下:

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

我还要尝试在Ubuntu服务器中的虚拟环境中以及在根文件夹中的sources.list文件中的sources.list文件之上的虚拟环境中安装docker。

我正在尝试将docker安装为我的超级账本网络设置所需的内容吗?

2 个答案:

答案 0 :(得分:0)

看起来docker没有Sources。但是无论如何,您都在寻找二进制文件。因此,删除deb-src行。

第二个错误必须来自不同的sources.list文件,也请检查/etc/apt/sources.list.d/。

但这两个都没有阻止你。丢失的索引文件将被忽略。他们并没有阻止您安装docker,因此您的问题必须是问题中未提及的其他问题。

答案 1 :(得分:-1)

从/etc/apt/sources.list删除所有docker条目,并删除所有/etc/apt/sources.list.d/docker*

然后只需将此脚本作为root用户使用即可:

curl https://get.docker.com | bash

或作为用户:

curl https://get.docker.com | sudo bash

然后通过编辑的脚本进行安装(删除的docker安装)

curl https://gist.githubusercontent.com/Razikus/6b61af8c69e563d587201c34f5c66568/raw/5608cdb81e33650b70ac934e261bbd5410269f7a/prereqs-ubuntu.sh | bash

根据评论,原始和更改之间的区别:

Differences between original and changed

从CLI检查差异:

diff <(curl https://hyperledger.github.io/composer/unstable/prereqs-ubuntu.sh) <(curl https://gist.githubusercontent.com/Razikus/6b61af8c69e563d587201c34f5c66568/raw/5608cdb81e33650b70ac934e261bbd5410269f7a/prereqs-ubuntu.sh)

比查找错误要快

相关问题