我无法在Ubuntu 17.10上安装Docker

时间:2019-10-21 13:31:46

标签: docker ubuntu-17.10

我正在尝试在ubuntu 17.10上安装Docker,因此我按照链接上的说明进行操作: https://docs.docker.com/install/linux/docker-ce/ubuntu/

 sudo apt-get update

它显示enter image description here

sudo apt-get install \
apt-transport-https \
ca-certificates \
curl \
gnupg-agent \
software-properties-common

显示 enter image description here

我该怎么办?

2 个答案:

答案 0 :(得分:0)

将/ usrLib / apt / methods中的https目录符号链接到http似乎可行:

$ cd /usr/lib/apt/methods
$ ln -s http https

确保在apt-get install apt-transport-https后没有配置https://的任何源,它实际上会覆盖带有正确文件的符号链接。

之后,运行docker安装脚本:

# remove old packages
$ sudo apt-get remove docker docker-engine docker.io containerd runc

# update
$ sudo apt-get update

# install dependencies
$ sudo apt-get install \
apt-transport-https \
ca-certificates \
curl \
gnupg-agent \
software-properties-common

# fetch rep
$ curl -fsSL https://download.docker.com/linux/ubuntu/gpg | sudo apt-key add -

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

# update
$ sudo apt-get update

# install
$ sudo apt-get install docker-ce docker-ce-cli containerd.io

这应该有效(来自official docs

答案 1 :(得分:0)

我在Ubuntu VM上安装Docker时遇到类似的问题。这就是对我有用的。

sudo apt update
sudo apt install apt-transport-https ca-certificates curl software-properties-common
curl -fsSL https://download.docker.com/linux/ubuntu/gpg | sudo apt-key add -
sudo add-apt-repository "deb [arch=amd64] https://download.docker.com/linux/ubuntu bionic stable"
sudo apt update
apt-cache policy docker-ce
sudo apt install docker-ce

最后sudo systemctl status docker检查它是否已正确安装。