I want to install one package with yum and not using rpm but with the same behavior like --replacefiles
in rpm. I have one package that have file conflicts with other and I need to install forcing with yum. This package is mine, so I can modify spec file.
You can use trigger scriptlets for this.
For illustration, let's say that the file
/etc/contested
is owned by a rpm namedgenerally
, and you have another package (specifically
) which wants to force-overwrite the same file.In
specifically.spec
, you install the new version of the file to%{_datadir}/%{name}/etc.contested
, and use this trigger scriptlet to install it to/etc
:%triggerin -- generally install -m 0644 %{_datadir}/%{name}/etc.contested %{_sysconfdir}/contested
The scriptlet will be run every time that
generally
is installed or updated, as well as every timespecifically
is installed or updated.RPM will still notice that the file isn't as it's expected to be, but it won't stop you from installing or uninstalling.
If you can modify spec file maybe you can remove the files that conflict in the files section ? Do you specify a folder in that section ? or file by file ?