RHEL ubi8 包 A 需要 B 但无法安装任何提供程序

问题描述

我有一个使用 registry.redhat.io/ubi8/ubi-minimal 作为基础镜像的 dockerfile。使用 microdnf 安装了 git,下载了几个软件包,但是在尝试使用 microdnf remove git 删除时,我收到了这些错误

microdnf --enablerepo=ubi-8-baSEOs --enablerepo=ubi-8-appstream install git

error: Could not depsolve transaction; 2 problems detected:
 Problem 1: package git-core-2.27.0-1.el8.x86_64 requires less,but none of the providers can be installed
  - conflicting requests
  - problem with installed package git-core-2.27.0-1.el8.x86_64
 Problem 2: package git-core-2.27.0-1.el8.x86_64 requires openssh-clients,but none of the providers can be installed
  - package git-core-doc-2.27.0-1.el8.noarch requires git-core = 2.27.0-1.el8,but none of the providers can be installed
  - conflicting requests
  - problem with installed package git-core-doc-2.27.0-1.el8.noarch

解决方法

重新排序包依赖项有助于解决问题。

microdnf remove libedit openssh openssh-clients git-core git-core-doc git less 有帮助。

希望 microdnf 也支持 dnf 的自动删除:(