我在使用 yum 解决我的项目的依赖项时遇到问题,该项目由我们自己构建的多个 RPM 组成。我已经建立了一个 RPM:
Requires: Database-devel = 1.0.0
但是当我运行时:
$ yum deplist Release/ConfigLoader-devel-4.0.1-0.191128.123053.g83eb.b.d.el7.x86_64.rpm
Loaded plugins: fastestmirror, langpacks
Loading mirror speeds from cached hostfile
* epel: epel.besthosting.ua
package: ConfigLoader-devel.x86_64 4.0.1-0.191128.123053.g83eb.b.d.el7
dependency: /bin/sh
provider: bash.x86_64 4.2.46-31.el7
dependency: Database-devel = 1.0.0
provider: Database-devel.x86_64 2.0.0-0.191126.123742.gb769.r
它表示该依赖项的提供者(最后一行)的版本为 2.0.0。以下附加信息确认 Database-devel 软件包的版本在 yum 存储库中设置正确,并且有 1.0.0 版本可供 yum 选择:
$ yum info Database-devel
Loaded plugins: fastestmirror, langpacks
Loading mirror speeds from cached hostfile
* epel: epel.besthosting.ua
Available Packages
Name : Database-devel
Arch : x86_64
Version : 2.0.0
Release : 0.191126.123742.gb769.r
Size : 13 k
Repo : localrepo-oel7
$ yum info Database-devel-1.0.0-1
Loaded plugins: fastestmirror, langpacks
Loading mirror speeds from cached hostfile
* epel: epel.besthosting.ua
Available Packages
Name : Database-devel
Arch : x86_64
Version : 1.0.0
Release : 1
Size : 13 k
Repo : localrepo-oel7
问题是当我尝试安装 ConfigLoader-devel RPM 时,它会尝试拉下 Database-devel 2.0.0 包并安装它,这会破坏我的构建。
我的百胜版本是:
$ yum --version
3.4.3
Installed: rpm-4.11.3-35.el7.x86_64 at 2019-05-21 13:14
Built : CentOS BuildSystem <http://bugs.centos.org> at 2018-10-30 19:27
Committed: Pavlina Moravcova Varekova <[email protected]> at 2018-06-19
Installed: yum-3.4.3-161.0.1.el7.noarch at 2019-06-05 11:27
Built : None at 2018-11-01 10:10
Committed: EL Errata <[email protected]> at 2018-10-31
Installed: yum-plugin-fastestmirror-1.1.31-50.el7.noarch at 2019-05-21 13:15
Built : CentOS BuildSystem <http://bugs.centos.org> at 2018-10-30 22:58
Committed: Michal Domonkos <[email protected]> at 2018-08-24
我该如何进一步诊断?
可能您的包裹
Database-devel
提供Database-devel
. 你可以这样检查:它应该这样说:
如果它还说:
没有版本号,那么这意味着
rpm
它yum
提供了所有版本Database-devel
,包括版本 1.0.0。您应该删除该行
从您的规范文件中。每个包都会自动提供自己的名称和版本。