安装 docker,出现:`PreDepends:init-system-helpers (>= 1.54~) 但需要安装 1.51`

安装 docker,出现:`PreDepends:init-system-helpers (>= 1.54~) 但需要安装 1.51`

所以这些是Docker 安装说明

您先请设置 GPG 密钥和先决条件它基本上包括:

  1. 从获取(最新).deb版本发布页面
  2. 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

经过一番谷歌搜索后,此解决方案被证明是有用的:

  1. wget http://ftp.kr.debian.org/debian/pool/main/i/init-system-helpers/init-system-helpers_1.60_all.deb
  2. sudo apt install ./init-system-helpers_1.60_all.deb
  3. 最后sudo apt install ./docker-desktop-4.8.1-amd64.deb

答案2

虽然手动安装较新版本init-system-helpers可能适用于私人安装或作为临时解决方法,但更稳定的解决方案似乎是将 Ubuntu 版本升级到至少 Focal,并希望 docker 人员不要这么快再次提高依赖性。

这可能由于其他各种原因而变得困难,但这里的关键见解似乎是 Docker - 尽管其文档中另有说明 - 确实不是支持Bionic(至少目前docker-desktop不支持,docker的其他部分可能有所不同)。

相关内容