使用RPM卸载程序包时出现意外的失败依赖项

问题描述 投票:3回答:2

当使用lz4检查依赖于特定包(在本例中为rpm)的包时,它不会列出任何需要lz4-1.7.5-2.el7.i686lz4-1.7.5-2.el7.x86_64的包...

# rpm -q --whatrequires lz4-1.7.5-2.el7.i686
no package requires lz4-1.7.5-2.el7.i686
# rpm -q --whatrequires lz4-1.7.5-2.el7.x86_64
no package requires lz4-1.7.5-2.el7.x86_64
#

但是我不能在不使用rpm --nodeps的情况下卸载其中任何一个,因为systemd和/或systemd-libs似乎需要它们。

# rpm --erase --allmatches lz4
error: Failed dependencies:
        liblz4.so.1()(64bit) is needed by (installed) systemd-libs-219-57.el7_5.1.x86_64
        liblz4.so.1()(64bit) is needed by (installed) systemd-219-57.el7_5.1.x86_64
        liblz4.so.1 is needed by (installed) systemd-libs-219-57.el7_5.1.i686
#

看起来rpm --whatrequires的输出是错误的但是它呢? (我怀疑它实际上是错的 - 但我不明白它为什么不包括systemdsystemd-libs

我想如果使用rpm --erase --test而不是rpm --whatrequires来识别是否具有依赖性的包但是还有另一种更可靠的方法来做到这一点?

谢谢你的帮助。

redhat rpm
2个回答
1
投票

这有点棘手。 rpm --whatrequires追踪能力;不仅仅是包裹。

如果你再试一次;你会看到:

rpm --whatrequires "liblz4.so.1()(64bit)"

将为您提供结果。

rpm --erase --test似乎是一个很好的方式去找我。另一种方法是循环使用要删除的包提供的功能;但那会慢一些。这是一个小的bash脚本,它循环遍历lz4的功能并打印依赖于这些功能的包:

packageToRemove=lz4
for capability in $(rpm -q $packageToRemove --provides | awk '{print $1}')
do
    echo "packages requiring $capability:"
    rpm -q --whatrequires "$capability"
done

1
投票

以下命令给出了我期待的结果,尽管我仍然不明白为什么rpm --whatrequires不起作用。 (在构建我的第一个包之前,我可能不会想到这一点)。

# repoquery --alldeps --whatrequires --cache --installed lz4
systemd-0:219-57.el7.x86_64
systemd-libs-0:219-57.el7.i686
systemd-libs-0:219-57.el7.x86_64
#

但在某些情况下,输出可能会“有趣”......

# repoquery --alldeps --whatrequires --cache --installed lvm2-libs
lvm2-7:2.02.177-4.el7.x86_64
lvm2-libs-7:2.02.177-4.el7.x86_64
# 

# repoquery --whatrequires --cache --installed lvm2
lvm2-7:2.02.177-4.el7.x86_64
# 
© www.soinside.com 2019 - 2024. All rights reserved.