skip to Main Content

I want to create rpm A, my requirement here is that whenever I install rpm A, It will replace some files which are part of installed rpm B.

for this in debian we used

Provides: pkg C
Conflicts: pkg C
Replaces: pkg C

Replacing whole packages, forcing their removal.

How can I do this in rpm spec file.

2

Answers


  1. Chosen as BEST ANSWER

    There are 2 solutions.

    1. Overlapping is not in supported rpm spec, but we can use commandline option rpm A --replacefile.

    2. Use Obsoletes: in RPM A spec file to remove older package or conflict packages and add Provides: in RPM A to make RPM B happy.

      Note: for option 2 rpm -i RPM A --> will not obsoletes packages. we have to use yum install RPM A or rpm -U RPM A


  2. If you want RPM B to go away, then yes, the same thing "Provides" (to make other RPMs looking for B happy) and "Conflicts" (to force the uninstall of B).

    If you want B to stick around, then you’re out of luck unless you can do a few esoteric things. The easiest would be to do something like myorg-common which contains these files and then myorg-a and myorg-b which conflict with each other but both require myorg-common (and provide each other).

    Login or Signup to reply.
Please signup or login to give your own answer.
Back To Top
Search