docker 无法安装

OpenStack/Juju/MAAS/CloudStack/Hadoop
william1204
帖子: 13
注册时间: 2019-07-22 2:06
系统: ubuntu 18.04

docker 无法安装

#1

帖子 william1204 » 2019-11-16 16:45

有台旧的笔记本用来当Samba共享用,最近又想折腾下docker,但是一直安装不上,我先在自己用的电脑上装了deepin 尝试安装docker 还是不行,(本来之前装了Ubuntu 19.10,但是开机开不了,应该怪硬盘)
这是我闲置笔记本上的Debian 10

————————————————————

root@MiWiFi-R4-srv:~#
root@MiWiFi-R4-srv:~# sudo apt-get remove docker docker-engine docker.io
正在读取软件包列表... 完成
正在分析软件包的依赖关系树
正在读取状态信息... 完成
软件包 docker-engine 未安装,所以不会被卸载
软件包 docker 未安装,所以不会被卸载
软件包 docker.io 未安装,所以不会被卸载
升级了 0 个软件包,新安装了 0 个软件包,要卸载 0 个软件包,有 29 个软件包未被升级。
root@MiWiFi-R4-srv:~# sudo apt-get install apt-transport-https ca-certificates curl gnupg2 software-properties-common
正在读取软件包列表... 完成
正在分析软件包的依赖关系树
正在读取状态信息... 完成
apt-transport-https 已经是最新版 (1.8.4)。
ca-certificates 已经是最新版 (20190110)。
curl 已经是最新版 (7.66.0-1+b1)。
gnupg2 已经是最新版 (2.2.17-3)。
software-properties-common 已经是最新版 (0.96.20.2-2)。
升级了 0 个软件包,新安装了 0 个软件包,要卸载 0 个软件包,有 29 个软件包未被升级。
root@MiWiFi-R4-srv:~# curl -fsSL https://download.docker.com/linux/debian/gpg | sudo apt-key add -
OK
root@MiWiFi-R4-srv:~# sudo add-apt-repository \
> "deb [arch=amd64] https://mirrors.tuna.tsinghua.edu.cn/do ... nux/debian \
> (lsb_release -cs) \
> stable"
Traceback (most recent call last):
File "/usr/bin/add-apt-repository", line 95, in <module>
sp = SoftwareProperties(options=options)
File "/usr/lib/python3/dist-packages/softwareproperties/SoftwareProperties.py", line 109, in __init__
self.reload_sourceslist()
File "/usr/lib/python3/dist-packages/softwareproperties/SoftwareProperties.py", line 599, in reload_sourceslist
self.distro.get_sources(self.sourceslist)
File "/usr/lib/python3/dist-packages/aptsources/distro.py", line 93, in get_sources
(self.id, self.codename))
aptsources.distro.NoDistroTemplateException: Error: could not find a distribution template for Kali/kali-rolling root@MiWiFi-R4-srv:~# sudo apt-get update
获取:1 http://mirrors.ustc.edu.cn/kali kali-rolling InRelease [30.5 kB]
获取:2 http://mirrors.ustc.edu.cn/kali kali-rolling/non-free Sources [133 kB]
获取:3 http://mirrors.ustc.edu.cn/kali kali-rolling/main Sources [12.7 MB]
获取:4 https://mirrors.tuna.tsinghua.edu.cn/debian stretch-backports InRelease [91.8 kB]
命中:5 https://mirrors.tuna.tsinghua.edu.cn/debian-security stretch/updates InRelease
获取:6 http://mirrors.ustc.edu.cn/kali kali-rolling/main amd64 Packages [16.5 MB]
错误:7 https://get.daocloud.io/docker/apt-repo debian-kali-rolling InRelease
403 FORBIDDEN [IP: 106.75.86.15 443]
获取:8 http://mirrors.ustc.edu.cn/kali kali-rolling/non-free amd64 Packages [191 kB]
正在读取软件包列表... 完成
E: 无法下载 https://get.daocloud.io/docker/apt-repo ... /InRelease 403 FORBIDDEN [IP: 106.75.86.15 443]
E: 仓库 “https://get.daocloud.io/docker/apt-repo debian-kali-rolling InRelease” 没有数字签名。
N: 无法安全地用该源进行更新,所以默认禁用该源。
N: 参见 apt-secure(8) 手册以了解仓库创建和用户配置方面的细节。
root@MiWiFi-R4-srv:~# sudo apt-get install docker-ce
正在读取软件包列表... 完成
正在分析软件包的依赖关系树
正在读取状态信息... 完成
没有可用的软件包 docker-ce,但是它被其它的软件包引用了。
这可能意味着这个缺失的软件包可能已被废弃,
或者只能在其他发布源中找到

E: 软件包 docker-ce 没有可安装候选
root@MiWiFi-R4-srv:~#


——————————————————————

不知道到怎么办。。。求教
onlylove
论坛版主
帖子: 5231
注册时间: 2007-01-14 16:23

Re: docker 无法安装

#2

帖子 onlylove » 2019-11-16 17:39

aptsources.distro.NoDistroTemplateException: Error: could not find a distribution template for Kali/kali-rolling

你添加软件源那一步就失败了,不看的么?
william1204
帖子: 13
注册时间: 2019-07-22 2:06
系统: ubuntu 18.04

Re: docker 无法安装

#3

帖子 william1204 » 2019-11-16 17:48

知道是那一步,但我改过Kali源,还是不行,具体怎么弄啊
onlylove
论坛版主
帖子: 5231
注册时间: 2007-01-14 16:23

Re: docker 无法安装

#4

帖子 onlylove » 2019-11-16 19:52

怎么怎么弄啊,你既然选择按照官方方法做,自然就按照官方的步骤来,官方不提供repo的自然没法用repo安装,你以为你list文件里面改了kali,官方就要给你kali的包?用手工包装就是了,我觉得官方的步骤挺详细的,你要装不上,先看下是不是网络问题,确保每一条命令运行都没错再说
onlylove
论坛版主
帖子: 5231
注册时间: 2007-01-14 16:23

Re: docker 无法安装

#5

帖子 onlylove » 2019-11-16 19:56

官方提供ubuntu debian fedora centos的repo和二进制包,其他发行版请安装二进制包,或者用发行版自带的docker

以下以debian为例,每条命令请确认没有错误后再执行下一条

简单说,装依赖
sudo apt-get install apt-transport-https ca-certificates curl gnupg2 software-properties-common

获取GPG key
curl -fsSL https://download.docker.com/linux/debian/gpg | sudo apt-key add -

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

然后更新源
sudo apt-get update

再然后安装
sudo apt-get install docker-ce docker-ce-cli containerd.io
william1204
帖子: 13
注册时间: 2019-07-22 2:06
系统: ubuntu 18.04

Re: docker 无法安装

#6

帖子 william1204 » 2019-11-16 21:57

还是不行。。。

————————————
root@MiWiFi-R4-srv:~# sudo apt-get install apt-transport-https ca-certificates curl gnupg2 software-properties-common
正在读取软件包列表... 完成
正在分析软件包的依赖关系树
正在读取状态信息... 完成
apt-transport-https 已经是最新版 (1.8.4)。
ca-certificates 已经是最新版 (20190110)。
curl 已经是最新版 (7.66.0-1+b1)。
gnupg2 已经是最新版 (2.2.17-3)。
software-properties-common 已经是最新版 (0.96.20.2-2)。
升级了 0 个软件包,新安装了 0 个软件包,要卸载 0 个软件包,有 0 个软件包未被升级。
root@MiWiFi-R4-srv:~# curl -fsSL https://download.docker.com/linux/debian/gpg | sudo apt-key add -
OK
root@MiWiFi-R4-srv:~# sudo add-apt-repository "deb [arch=amd64] https://download.docker.com/linux/debian $(lsb_release -cs) stable"
Traceback (most recent call last):
File "/usr/bin/add-apt-repository", line 95, in <module>
sp = SoftwareProperties(options=options)
File "/usr/lib/python3/dist-packages/softwareproperties/SoftwareProperties.py", line 109, in __init__
self.reload_sourceslist()
File "/usr/lib/python3/dist-packages/softwareproperties/SoftwareProperties.py", line 599, in reload_sourceslist self.distro.get_sources(self.sourceslist)
File "/usr/lib/python3/dist-packages/aptsources/distro.py", line 93, in get_sources
(self.id, self.codename))
aptsources.distro.NoDistroTemplateException: Error: could not find a distribution template for Kali/kali-rolling
root@MiWiFi-R4-srv:~#
onlylove
论坛版主
帖子: 5231
注册时间: 2007-01-14 16:23

Re: docker 无法安装

#7

帖子 onlylove » 2019-11-16 22:11

你这根本不是debian 吧,lsb_release -a看看输出是什么,如果是debian 10,把 $(lsb_release -cs)换成buster
william1204
帖子: 13
注册时间: 2019-07-22 2:06
系统: ubuntu 18.04

Re: docker 无法安装

#8

帖子 william1204 » 2019-11-16 22:17

等下,好像是我Debian系统有问题,我在试一试
william1204
帖子: 13
注册时间: 2019-07-22 2:06
系统: ubuntu 18.04

Re: docker 无法安装

#9

帖子 william1204 » 2019-11-17 12:32

装上了,装上了

root@Mi-Desrv:~# sudo systemctl status docker
● docker.service - Docker Application Container Engine
Loaded: loaded (/lib/systemd/system/docker.service; enabled; vendor preset: enabled)
Active: active (running) since Sun 2019-11-17 11:00:24 CST; 5min ago
Docs: https://docs.docker.com
Main PID: 11889 (dockerd)
Tasks: 10
Memory: 45.4M
CGroup: /system.slice/docker.service
└─11889 /usr/bin/dockerd -H fd:// --containerd=/run/containerd/containerd.sock

11月 17 11:00:22 Mi-Desrv dockerd[11889]: time="2019-11-17T11:00:22.583732972+08:00" level=warning msg="Your k11月 17 11:00:22 Mi-Desrv dockerd[11889]: time="2019-11-17T11:00:22.583865946+08:00" level=warning msg="Your k11月 17 11:00:22 Mi-Desrv dockerd[11889]: time="2019-11-17T11:00:22.583915323+08:00" level=warning msg="Your k11月 17 11:00:22 Mi-Desrv dockerd[11889]: time="2019-11-17T11:00:22.584893563+08:00" level=info msg="Loading c11月 17 11:00:23 Mi-Desrv dockerd[11889]: time="2019-11-17T11:00:23.342227026+08:00" level=info msg="Default b11月 17 11:00:23 Mi-Desrv dockerd[11889]: time="2019-11-17T11:00:23.573576209+08:00" level=info msg="Loading c11月 17 11:00:23 Mi-Desrv dockerd[11889]: time="2019-11-17T11:00:23.830664697+08:00" level=info msg="Docker da11月 17 11:00:23 Mi-Desrv dockerd[11889]: time="2019-11-17T11:00:23.830938468+08:00" level=info msg="Daemon ha11月 17 11:00:24 Mi-Desrv dockerd[11889]: time="2019-11-17T11:00:24.180781839+08:00" level=info msg="API liste11月 17 11:00:24 Mi-Desrv systemd[1]: Started Docker Application Container Engine.
root@Mi-Desrv:~# docker container run hello-world
Unable to find image 'hello-world:latest' locally
latest: Pulling from library/hello-world
1b930d010525: Pull complete
Digest: sha256:c3b4ada4687bbaa170745b3e4dd8ac3f194ca95b2d0518b417fb47e5879d9b5f
Status: Downloaded newer image for hello-world:latest

Hello from Docker!
This message shows that your installation appears to be working correctly.

To generate this message, Docker took the following steps:
1. The Docker client contacted the Docker daemon.
2. The Docker daemon pulled the "hello-world" image from the Docker Hub.
(amd64)
3. The Docker daemon created a new container from that image which runs the
executable that produces the output you are currently reading.
4. The Docker daemon streamed that output to the Docker client, which sent it
to your terminal.

To try something more ambitious, you can run an Ubuntu container with:
$ docker run -it ubuntu bash

Share images, automate workflows, and more with a free Docker ID:
https://hub.docker.com/

For more examples and ideas, visit:
https://docs.docker.com/get-started/

感谢版主
GuoZiZhou
帖子: 1
注册时间: 2020-05-17 23:29
系统: ubuntu 20.04

Re: docker 无法安装

#10

帖子 GuoZiZhou » 2020-05-17 23:43

ubuntu 20.04 按照官网流程安装docker engine 出现问题 :

1.
guozz@guozz-XPS-15-9570:~$ sudo apt-get update
[sudo] guozz 的密码:
命中:1 http://cn.archive.ubuntu.com/ubuntu focal InRelease
命中:2 http://repo.mysql.com/apt/ubuntu focal InRelease
获取:3 http://security.ubuntu.com/ubuntu focal-security InRelease [107 kB]
命中:4 http://ppa.launchpad.net/git-core/ppa/ubuntu focal InRelease
获取:5 http://cn.archive.ubuntu.com/ubuntu focal-updates InRelease [107 kB]
获取:6 http://cn.archive.ubuntu.com/ubuntu focal-backports InRelease [98.3 kB]
获取:7 http://security.ubuntu.com/ubuntu focal-security/main amd64 DEP-11 Metadata [16.6 kB]
获取:8 http://cn.archive.ubuntu.com/ubuntu focal-updates/main amd64 DEP-11 Metadata [90.5 kB]
获取:9 http://security.ubuntu.com/ubuntu focal-security/universe amd64 DEP-11 Metadata [208 B]
获取:10 http://cn.archive.ubuntu.com/ubuntu focal-updates/universe amd64 DEP-11 Metadata [21.5 kB]
获取:11 http://cn.archive.ubuntu.com/ubuntu focal-backports/universe amd64 DEP-11 Metadata [528 B]
已下载 441 kB,耗时 4秒 (110 kB/s)
正在读取软件包列表... 完成


2.
guozz@guozz-XPS-15-9570:~$ sudo apt-get install \
> apt-transport-https \
> ca-certificates \
> curl \
> gnupg-agent \
> software-properties-common
正在读取软件包列表... 完成
正在分析软件包的依赖关系树
正在读取状态信息... 完成
ca-certificates 已经是最新版 (20190110ubuntu1)。
ca-certificates 已设置为手动安装。
curl 已经是最新版 (7.68.0-1ubuntu2)。
software-properties-common 已经是最新版 (0.98.9)。
software-properties-common 已设置为手动安装。
下列【新】软件包将被安装:
apt-transport-https gnupg-agent
升级了 0 个软件包,新安装了 2 个软件包,要卸载 0 个软件包,有 8 个软件包未被升级。
需要下载 6,944 B 的归档。
解压缩后会消耗 206 kB 的额外空间。
您希望继续执行吗? [Y/n] Y
获取:1 http://cn.archive.ubuntu.com/ubuntu focal-updates/universe amd64 apt-transport-https all 2.0.2ubuntu0.1 [1,708 B]
获取:2 http://cn.archive.ubuntu.com/ubuntu focal/universe amd64 gnupg-agent all 2.2.19-3ubuntu2 [5,236 B]
已下载 6,944 B,耗时 2秒 (3,069 B/s)
正在选中未选择的软件包 apt-transport-https。
(正在读取数据库 ... 系统当前共安装有 167946 个文件和目录。)
准备解压 .../apt-transport-https_2.0.2ubuntu0.1_all.deb ...
正在解压 apt-transport-https (2.0.2ubuntu0.1) ...
正在选中未选择的软件包 gnupg-agent。
准备解压 .../gnupg-agent_2.2.19-3ubuntu2_all.deb ...
正在解压 gnupg-agent (2.2.19-3ubuntu2) ...
正在设置 apt-transport-https (2.0.2ubuntu0.1) ...
正在设置 gnupg-agent (2.2.19-3ubuntu2) ...


3.
guozz@guozz-XPS-15-9570:~$ curl -fsSL https://download.docker.com/linux/ubuntu/gpg | sudo apt-key add -
OK


4.
guozz@guozz-XPS-15-9570:~$ sudo apt-key fingerprint 0EBFCD88
pub rsa4096 2017-02-22 [SCEA]
9DC8 5822 9FC7 DD38 854A E2D8 8D81 803C 0EBF CD88
uid [ 未知 ] Docker Release (CE deb) <docker@docker.com>
sub rsa4096 2017-02-22


5.
guozz@guozz-XPS-15-9570:~$ sudo add-apt-repository \
> "deb [arch=amd64] https://download.docker.com/linux/ubuntu \
> $(lsb_release -cs) \
> stable"
命中:1 http://repo.mysql.com/apt/ubuntu focal InRelease
命中:2 http://cn.archive.ubuntu.com/ubuntu focal InRelease
命中:3 http://security.ubuntu.com/ubuntu focal-security InRelease
命中:4 http://ppa.launchpad.net/git-core/ppa/ubuntu focal InRelease
获取:5 https://download.docker.com/linux/ubuntu focal InRelease [33.5 kB]
命中:6 http://cn.archive.ubuntu.com/ubuntu focal-updates InRelease
命中:7 http://cn.archive.ubuntu.com/ubuntu focal-backports InRelease
获取:8 https://download.docker.com/linux/ubuntu focal/stable amd64 Packages [536 B]
已下载 34.0 kB,耗时 2秒 (22.4 kB/s)
正在读取软件包列表... 完成


6.
guozz@guozz-XPS-15-9570:~$ sudo apt-get install docker-ce docker-ce-cli containerd.io
正在读取软件包列表... 完成
正在分析软件包的依赖关系树
正在读取状态信息... 完成
没有可用的软件包 docker-ce,但是它被其它的软件包引用了。
这可能意味着这个缺失的软件包可能已被废弃,
或者只能在其他发布源中找到

E: 软件包 docker-ce 没有可安装候选
E: 无法定位软件包 docker-ce-cli
头像
qy117121
论坛版主
帖子: 50546
注册时间: 2007-12-14 13:40
系统: Winbuntu
来自: 志虚国乌由市
联系:

Re: docker 无法安装

#11

帖子 qy117121 » 2020-05-17 23:57

20.04的docker官方源正在准备,当前时间还没准备好,改天试试吧

https://download.docker.com/linux/ubunt ... ble/amd64/
我现在只看到了containerd.io,别的都还没有
渠月 · QY   
本人只会灌水,不负责回答问题
无聊可以点一下→ http://u.nu/ubuntu

Ubuntu 20.04 快速设置指南,请配合浏浏览器自动翻译使用

邮箱 chuan@ubuntu.org.cn
头像
qy117121
论坛版主
帖子: 50546
注册时间: 2007-12-14 13:40
系统: Winbuntu
来自: 志虚国乌由市
联系:

Re: docker 无法安装

#12

帖子 qy117121 » 2020-05-18 0:00

图片
18.04

图片
20.04
渠月 · QY   
本人只会灌水,不负责回答问题
无聊可以点一下→ http://u.nu/ubuntu

Ubuntu 20.04 快速设置指南,请配合浏浏览器自动翻译使用

邮箱 chuan@ubuntu.org.cn
头像
qy117121
论坛版主
帖子: 50546
注册时间: 2007-12-14 13:40
系统: Winbuntu
来自: 志虚国乌由市
联系:

Re: docker 无法安装

#13

帖子 qy117121 » 2020-05-18 0:09

我用的是源里的docker.io,sudo apt install docker.io
sudo systemctl enable docker.service #添加开机启动
渠月 · QY   
本人只会灌水,不负责回答问题
无聊可以点一下→ http://u.nu/ubuntu

Ubuntu 20.04 快速设置指南,请配合浏浏览器自动翻译使用

邮箱 chuan@ubuntu.org.cn
头像
zys7677
帖子: 58
注册时间: 2020-08-03 13:44
系统: Ubuntu20.04LTS
联系:

Re: docker 无法安装

#14

帖子 zys7677 » 2020-08-04 9:48

终端输入这些

代码: 全选

apt install docker
头像
zys7677
帖子: 58
注册时间: 2020-08-03 13:44
系统: Ubuntu20.04LTS
联系:

Re: docker 无法安装

#15

帖子 zys7677 » 2020-08-04 9:50

先写

代码: 全选

apt-get install update
ps:很多软件安装不了是因为系统版本太低,建议升级
(此方法可能对LinuxMint没作用)
回复