How to make an existing rpm obsolete a new rpm without modify the existing rpm's spec file

一笑奈何 提交于 2019-12-11 17:23:51

问题


My team is going to add a new RPM, Y, to the user land. There has been an RPM, X, which has to be mutually exclusive with Y. In other words, X and Y must not coexist.

Thus, in the spec file of Y, there is a line saying "Obsolete: X."

The thing is that we cannot modify the spec file of X. When it was written, there was no such package named Y. Thus, it neither "Obsoletes" nor "Conflicts" Y.

We may add more fake/virtual/meta packages to the user land. Is there anyway that the existing package X also effectively obsoletes the new package Y?

yum install X

must remove Y if it is installed.


回答1:


See the Fedora Guidelines for obsoleting packages: https://fedoraproject.org/wiki/Packaging:Guidelines#Renaming.2FReplacing_Existing_Packages It provides a comprehensive description.

But according your description you do not want to use 'obsoletes'. This is used when you replace one package with another one. E.g., when the project change the name and therefore the package change the name and you want to replace old-name-2.0 with new-name-3.0 or even new-name-1.0.

You want to use Conflicts and it is enough to put this tag into one of this packages. When Y spec will have:

Conflicts: X

then you do not need to alter X and you cannot install X and Y at the same time.




回答2:


I have no knowledge of making that possible, but you can add

Conflicts: X

inside your spec file for Y. That way they can't be both installed together.



来源:https://stackoverflow.com/questions/52763387/how-to-make-an-existing-rpm-obsolete-a-new-rpm-without-modify-the-existing-rpms

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!