rpm命令支持--replacefiles选项(--force的子集),它允许包覆盖另一个已安装包拥有的文件。
示例:包'myrpm‘拥有多个文件,并且已经安装。我想安装‘myrpm-自定义补丁’,它覆盖了一个文件拥有我的'mrrpm‘。
# rpm -q myrpm
myrpm-1.0-0.x86_64
# rpm -ivh myrpm-custom-patch-2.0-0.x86_64.rpm
Verifying... ################################# [100%]
Preparing... ################################# [100%]
file /usr/share/myfile from install of myrpm-custom-patch-2.0-0.x86_64 conflicts with file from package myrpm-1.0-0.x86_64
# rpm -ivh --replacefiles myrpm-custom-patch-2.0-0.x86_64.rpm
Verifying... ################################# [100%]
Preparing... ################################# [100%]
Updating / installing...
1:myrpm-custom-patch-2.0-0 ################################# [100%]
# rpm -q myrpm-custom-patch-2.0-0.x86_64.rpm
myrpm-custom-patch-2.0-0.x86_64如果我想使用dnf命令而不是rpm命令来安装,那么是否有任何等效的选项来强制替换其他软件包拥有的文件?
发布于 2022-10-27 06:11:53
正如红帽子小组所证实的那样,dnf不支持这一点。
这里有更多详细信息:https://bugzilla.redhat.com/show_bug.cgi?id=2129808
https://stackoverflow.com/questions/73851875
复制相似问题