ちゃんるいすのブログ

オタクエンジニアの雑記

dnf install の --nobest オプション


CentOS 8 を最近触るようになった。

dnf install --nobest

例えば、依存関係でパッケージが入れることができなかった場合

[root@nomad01 ~]# dnf install docker-ce
Last metadata expiration check: 0:03:38 ago on Thu Dec  5 21:34:46 2019.
Error:
 Problem: package docker-ce-3:18.09.9-3.el7.x86_64 requires containerd.io >= 1.2.2-3, but none of the providers can be installed
  - conflicting requests
  - package containerd.io-1.2.10-3.2.el7.x86_64 is excluded
  - package containerd.io-1.2.2-3.3.el7.x86_64 is excluded
  - package containerd.io-1.2.2-3.el7.x86_64 is excluded
  - package containerd.io-1.2.4-3.1.el7.x86_64 is excluded
  - package containerd.io-1.2.5-3.1.el7.x86_64 is excluded
  - package containerd.io-1.2.6-3.3.el7.x86_64 is excluded
(try to add '--skip-broken' to skip uninstallable packages or '--nobest' to use not only best candidate packages)

--nobest をつけると

[root@nomad01 ~]# dnf install --nobest docker-ce
Dependencies resolved.

Problem: package docker-ce-3:19.03.2-3.el7.x86_64 requires containerd.io >= 1.2.2-3, but none of the providers can be installed
  - cannot install the best candidate for the job
  - package containerd.io-1.2.2-3.3.el7.x86_64 is excluded
  - package containerd.io-1.2.2-3.el7.x86_64 is excluded
  - package containerd.io-1.2.4-3.1.el7.x86_64 is excluded
  - package containerd.io-1.2.5-3.1.el7.x86_64 is excluded
  - package containerd.io-1.2.6-3.3.el7.x86_64 is excluded
=======================================================================================================================================================
 Package                            Arch         Version                                                  Repository                              Size
=======================================================================================================================================================
Installing:
 docker-ce                          x86_64       3:18.09.1-3.el7                                          docker-ce-stable                        19 M
Installing dependencies:
 containerd.io                      x86_64       1.2.0-3.el7                                              docker-ce-stable                        22 M
 docker-ce-cli                      x86_64       1:19.03.2-3.el7                                          docker-ce-stable                        39 M
 container-selinux                  noarch       2:2.94-1.git1e99f1d.module+el8.0.0+4017+bbba319f         rhel-8-for-x86_64-appstream-rpms        43 k
 tar                                x86_64       2:1.30-4.el8                                             rhel-8-for-x86_64-baseos-rpms          838 k
 libcgroup                          x86_64       0.41-19.el8                                              rhel-8-for-x86_64-baseos-rpms           70 k
 python3-policycoreutils            noarch       2.8-16.1.el8                                             rhel-8-for-x86_64-baseos-rpms          2.2 M
 python3-libsemanage                x86_64       2.8-5.el8                                                rhel-8-for-x86_64-baseos-rpms          127 k
 python3-setools                    x86_64       4.2.0-2.el8                                              rhel-8-for-x86_64-baseos-rpms          598 k
 checkpolicy                        x86_64       2.8-2.el8                                                rhel-8-for-x86_64-baseos-rpms          338 k
 python3-audit                      x86_64       3.0-0.10.20180831git0047a6c.el8                          rhel-8-for-x86_64-baseos-rpms           85 k
 policycoreutils-python-utils       noarch       2.8-16.1.el8                                             rhel-8-for-x86_64-baseos-rpms          228 k
Skipping packages with broken dependencies:
 docker-ce                          x86_64       3:19.03.2-3.el7                                          docker-ce-stable                        24 M

Transaction Summary
=======================================================================================================================================================
Install  12 Packages
Skip      1 Package

Total download size: 85 M
Installed size: 351 M
Is this ok [y/N]: 

最新はインストールできないけど docker-ce-3:18.09.1-3.el7 は入れれたよっていう話