![安装 docker,出现:`PreDepends:init-system-helpers (>= 1.54~) 但需要安装 1.51`](https://linux22.com/image/1187040/%E5%AE%89%E8%A3%85%20docker%EF%BC%8C%E5%87%BA%E7%8E%B0%EF%BC%9A%60PreDepends%EF%BC%9Ainit-system-helpers%20(%3E%3D%201.54~)%20%E4%BD%86%E9%9C%80%E8%A6%81%E5%AE%89%E8%A3%85%201.51%60.png)
所以这些是Docker 安装说明
您先请设置 GPG 密钥和先决条件它基本上包括:
- 从获取(最新)
.deb
版本发布页面 sudo apt install ./docker-desktop-<version>-<arch>.deb
我收到以下错误:
Reading package lists... Done
Building dependency tree
Reading state information... Done
Note, selecting 'docker-desktop' instead of './docker-desktop-4.8.1-amd64.deb'
Some packages could not be installed. This may mean that you have
requested an impossible situation or if you are using the unstable
distribution that some required packages have not yet been created
or been moved out of Incoming.
The following information may help to resolve the situation:
The following packages have unmet dependencies.
docker-desktop : PreDepends: init-system-helpers (>= 1.54~) but 1.51 is to be installed
E: Unable to correct problems, you have held broken packages.
但如果我尝试的sudo apt upgrade init-system-helpers
话我会得到:
Reading package lists... Done
Building dependency tree
Reading state information... Done
init-system-helpers is already the newest version (1.51).
解决这个问题的办法是什么?安装 Docker 吗?
答案1
经过一番谷歌搜索后,此解决方案被证明是有用的:
wget http://ftp.kr.debian.org/debian/pool/main/i/init-system-helpers/init-system-helpers_1.60_all.deb
sudo apt install ./init-system-helpers_1.60_all.deb
- 最后
sudo apt install ./docker-desktop-4.8.1-amd64.deb
答案2
虽然手动安装较新版本init-system-helpers
可能适用于私人安装或作为临时解决方法,但更稳定的解决方案似乎是将 Ubuntu 版本升级到至少 Focal,并希望 docker 人员不要这么快再次提高依赖性。
这可能由于其他各种原因而变得困难,但这里的关键见解似乎是 Docker - 尽管其文档中另有说明 - 确实不是支持Bionic(至少目前docker-desktop
不支持,docker的其他部分可能有所不同)。