カスタムDebianパッケージの欠落している依存関係をどのようにインストールしますか?

カスタムDebianパッケージの欠落している依存関係をどのようにインストールしますか?

カスタムDebianパッケージには、Debian制御ファイルに次の依存関係があります。

Depends: docker-ce (=17.03.2~ce-0~debian-stretch)

download.docker.com公式のDebianリポジトリの一部ではないので、ここからダウンロードする必要があります。適切なソースのリストは次のとおりです。

# cat /etc/apt/sources.list /etc/apt/sources.list.d/*
deb http://deb.debian.org/debian stretch main
deb http://security.debian.org/debian-security stretch/updates main
deb http://deb.debian.org/debian stretch-updates main
deb https://download.docker.com/linux/debian stretch stable

カスタムDebianパッケージのインストールに失敗しました。

# dpkg --install --force-depends foo.deb
Selecting previously unselected package foo.
(Reading database ... 15743 files and directories currently installed.)
Preparing to unpack foo.deb ...
Unpacking foo (0.0.0-1) ...
dpkg: foo: dependency problems, but configuring anyway as you requested:
 foo depends on docker-ce (= 17.03.2~ce-0~debian-stretch); however:
  Package docker-ce is not installed.
Setting up foo (0.0.0-1) ...
# apt --fix-broken install
Reading package lists... Done
Building dependency tree       
Reading state information... Done
Correcting dependencies... Done
The following packages will be REMOVED:
  foo
0 upgraded, 0 newly installed, 1 to remove and 18 not upgraded.
After this operation, 0 B of additional disk space will be used.
Do you want to continue? [Y/n]

私はサードパーティのリポジトリから欠落しているパッケージをインストールすると思いましたが、apt --fix-broken代わりに私のパッケージを削除しようとしています。以下はうまくいきます:docker-cefoo

# apt-get install docker-ce=17.03.2~ce-0~debian-stretch
# dpkg --install foo.deb

私が今まで試したこと:

# apt-get -o Debug::pkgProblemResolver=true install -f
Reading package lists... Done
Building dependency tree       
Reading state information... Done
Correcting dependencies...Starting pkgProblemResolver with broken count: 1
Starting 2 pkgProblemResolver with broken count: 1
Investigating (0) foo:amd64 < 0.0.0-1 @iU mK Nb Ib >
Broken foo:amd64 Depends on docker-ce:amd64 < none | 5:18.09.2~3-0~debian-stretch @un uH > (= 17.03.2~ce-0~debian-stretch)
  Considering docker-ce:amd64 0 as a solution to foo:amd64 2
  Removing foo:amd64 rather than change docker-ce:amd64

# apt install --assume-yes $PWD/foo.deb
Reading package lists... Done
Building dependency tree       
Reading state information... Done
Note, selecting 'foo' instead of '/src/foo.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:
 foo : Depends: docker-ce (= 17.03.2~ce-0~debian-stretch) but 5:18.09.2~3-0~debian-stretch is to be installed
E: Unable to correct problems, you have held broken packages.

# apt-cache policy docker-ce
docker-ce:
  Installed: (none)
  Candidate: 5:18.09.2~3-0~debian-stretch
  Version table:
     5:18.09.2~3-0~debian-stretch 500
        500 https://download.docker.com/linux/debian stretch/stable amd64 Packages
     5:18.09.1~3-0~debian-stretch 500
        500 https://download.docker.com/linux/debian stretch/stable amd64 Packages
     5:18.09.0~3-0~debian-stretch 500
        500 https://download.docker.com/linux/debian stretch/stable amd64 Packages
     18.06.3~ce~3-0~debian 500
        500 https://download.docker.com/linux/debian stretch/stable amd64 Packages
     18.06.2~ce~3-0~debian 500
        500 https://download.docker.com/linux/debian stretch/stable amd64 Packages
     18.06.1~ce~3-0~debian 500
        500 https://download.docker.com/linux/debian stretch/stable amd64 Packages
     18.06.0~ce~3-0~debian 500
        500 https://download.docker.com/linux/debian stretch/stable amd64 Packages
     18.03.1~ce-0~debian 500
        500 https://download.docker.com/linux/debian stretch/stable amd64 Packages
     18.03.0~ce-0~debian 500
        500 https://download.docker.com/linux/debian stretch/stable amd64 Packages
     17.12.1~ce-0~debian 500
        500 https://download.docker.com/linux/debian stretch/stable amd64 Packages
     17.12.0~ce-0~debian 500
        500 https://download.docker.com/linux/debian stretch/stable amd64 Packages
     17.09.1~ce-0~debian 500
        500 https://download.docker.com/linux/debian stretch/stable amd64 Packages
     17.09.0~ce-0~debian 500
        500 https://download.docker.com/linux/debian stretch/stable amd64 Packages
     17.06.2~ce-0~debian 500
        500 https://download.docker.com/linux/debian stretch/stable amd64 Packages
     17.06.1~ce-0~debian 500
        500 https://download.docker.com/linux/debian stretch/stable amd64 Packages
     17.06.0~ce-0~debian 500
        500 https://download.docker.com/linux/debian stretch/stable amd64 Packages
     17.03.3~ce-0~debian-stretch 500
        500 https://download.docker.com/linux/debian stretch/stable amd64 Packages
     17.03.2~ce-0~debian-stretch 500
        500 https://download.docker.com/linux/debian stretch/stable amd64 Packages
     17.03.1~ce-0~debian-stretch 500
        500 https://download.docker.com/linux/debian stretch/stable amd64 Packages
     17.03.0~ce-0~debian-stretch 500
        500 https://download.docker.com/linux/debian stretch/stable amd64 Packages

ベストアンサー1

.deb設定されたリポジトリから依存関係のダウンロード中にパッケージをインストールするには、次のようにします。

# apt install ./foo.deb

ファイルが現在のディレクトリにある場合でも、パスを指定します。

それでも依存関係が見つからない場合は、出力を表示してくださいapt-cache policy docker-ce

おすすめ記事