How to make an existing rpm obsolete a new rpm wit

2019-08-25 01:50发布

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.

标签: rpm rpm-spec
2条回答
看我几分像从前
2楼-- · 2019-08-25 02:17

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.

查看更多
我想做一个坏孩纸
3楼-- · 2019-08-25 02:24

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.

查看更多
登录 后发表回答