Search code examples
rpmrpmbuildrpm-spec

How to create rpm A which support overlapping of installed rpm B files?


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.


Solution

  • 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