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
There are 2 solutions.
Overlapping is not in supported rpm spec, but we can use commandline option
rpm A --replacefile
.Use
Obsoletes:
in RPM A spec file to remove older package or conflict packages and addProvides:
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
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 thenmyorg-a
andmyorg-b
which conflict with each other but both requiremyorg-common
(and provide each other).