关于有优班图安装 docker 失败

2023-04-20 13:32:27 +08:00
 wzry2580

安装老提示这个 :Command 'docker' not found, but can be installed with:

snap install docker # version 20.10.17, or apt install docker.io # version 20.10.21-0ubuntu1~20.04.1

See 'snap info docker' for additional versions.

root@serimt4vdimm4ap:~# apt install docker.io Reading package lists... Done Building dependency tree Reading state information... Done You might want to run 'apt --fix-broken install' to correct these. The following packages have unmet dependencies: docker.io : Depends: containerd (>= 1.2.6-0ubuntu1~) Recommends: pigz but it is not going to be installed Recommends: ubuntu-fan but it is not going to be installed php-cli : Depends: php7.4-cli but it is not going to be installed php-zip : Depends: php-common but it is not going to be installed php7.4-common : Depends: php-common (>= 1:73) but it is not going to be installed php7.4-json : Depends: php-common (>= 1:73) but it is not going to be installed php7.4-opcache : Depends: php-common (>= 1:73) but it is not going to be installed php7.4-readline : Depends: php-common (>= 1:73) but it is not going to be installed php7.4-zip : Depends: php-common (>= 1:73) but it is not going to be installed E: Unmet dependencies. Try 'apt --fix-broken install' with

一直导致我安装失败,请问有什么解决办法,通过命令的形式

2255 次点击
所在节点    Ubuntu
9 条回复
dier
2023-04-20 14:19:38 +08:00
现在安装的社区版名称叫 docker-ce 。

参考官方文档来安装吧 https://docs.docker.com/engine/install/ubuntu/
wzry2580
2023-04-20 14:28:07 +08:00
还是装不了,W: Target Packages (stable/binary-amd64/Packages) is configured multiple times in /etc/apt/sources.list:58 and /etc/apt/sources.list.d/docker.list:1
W: Target Packages (stable/binary-all/Packages) is configured multiple times in /etc/apt/sources.list:58 and /etc/apt/sources.list.d/docker.list:1
W: Target Translations (stable/i18n/Translation-en) is configured multiple times in /etc/apt/sources.list:58 and /etc/apt/sources.list.d/docker.list:1
W: Target CNF (stable/cnf/Commands-amd64) is configured multiple times in /etc/apt/sources.list:58 and /etc/apt/sources.list.d/docker.list:1
W: Target CNF (stable/cnf/Commands-all) is configured multiple times in /etc/apt/sources.list:58 and /etc/apt/sources.list.d/docker.list:1
W: Target Packages (stable/binary-amd64/Packages) is configured multiple times in /etc/apt/sources.list:58 and /etc/apt/sources.list.d/docker.list:1
W: Target Packages (stable/binary-all/Packages) is configured multiple times in /etc/apt/sources.list:58 and /etc/apt/sources.list.d/docker.list:1
W: Target Translations (stable/i18n/Translation-en) is configured multiple times in /etc/apt/sources.list:58 and /etc/apt/sources.list.d/docker.list:1
W: Target CNF (stable/cnf/Commands-amd64) is configured multiple times in /etc/apt/sources.list:58 and /etc/apt/sources.list.d/docker.list:1
W: Target CNF (stable/cnf/Commands-all) is configured multiple times in /etc/apt/sources.list:58 and /etc/apt/sources.list.d/docker.list:1
dier
2023-04-20 14:36:59 +08:00
/etc/apt/sources.list 58 行 跟 /etc/apt/sources.list.d/docker.list 的第一行有重复啊
exqibao
2023-04-20 16:07:57 +08:00
所有操作前备份;

编辑清理 /etc/apt/sources.list 里,docker 相关行配置;

删除 /etc/apt/sources.list.d/docker.list 文件;

重新执行以下命令,“--mirror Aliyun”使用阿里服务器,国内下载更快,参考 https://docs.docker.com/engine/install/ubuntu/

curl -fsSL https://get.docker.com -o get-docker.sh
sudo sh get-docker.sh --mirror Aliyun
haimianbihdata
2023-04-20 16:17:17 +08:00
@exqibao 前天用的就是阿里云的镜像下载 docker 。出问题。包不匹配好像。建议用腾讯云的镜像
ysc3839
2023-04-20 16:27:49 +08:00
建议重装系统
tony1016
2023-04-20 16:34:04 +08:00
人家都说了,你的依赖有问题了,用 apt --fix-broken install 修复
maxwell29
2023-04-20 20:44:25 +08:00
我装了三次,实体机,虚拟机,都没问题。docker 和乌班图
xjqxz2
2023-04-21 10:54:13 +08:00
哈哈 我用了 PODMAN~感觉体验和 DOCKER 一样一样的

这是一个专为移动设备优化的页面(即为了让你能够在 Google 搜索结果里秒开这个页面),如果你希望参与 V2EX 社区的讨论,你可以继续到 V2EX 上打开本讨论主题的完整版本。

https://www.v2ex.com/t/934008

V2EX 是创意工作者们的社区,是一个分享自己正在做的有趣事物、交流想法,可以遇见新朋友甚至新机会的地方。

V2EX is a community of developers, designers and creative people.

© 2021 V2EX