3

I have a software package[1] that is already being used by multiple users.
Its RPM is created with Cmake.

For historical reasons, the software package installs some files in a subdirectory of /opt.
Consequently, if any of these files is changed, Cmake assumes that since the changed file resides in /opt, it is a configuration file (AFAIK, as only config files should go under /opt), and if a yum reinstall of the package is performed, the changed file is not overwritten.

The obvious solution is to install to a non /opt location, e.g., to /usr.
This would work for new versions, but as I said, I have a user-base where /opt is used.

Any ideas on how to force yum reinstall to overwrite the changed files in the /opt sub-directory?



[1] OS: CentOS/RedHat 7.{3|4|6}

boardrider
  • 1,055
  • 6
  • 20
  • 36
  • Have you simply tried `-force` and/or `/force`, with the number of point releases within the RedHat Enterprise Linux family, `RedHat 7` isn't descriptive enough to be helpful[.](https://superuser.com/questions/338296/how-to-use-yum-to-reinstall-all-dependencies-of-a-given-package) – Ramhound Mar 06 '19 at 22:30
  • I'm not sure I understand you, @Ramhound: where do you suggest I use -force? In `yum reinstall`? – boardrider Mar 06 '19 at 22:43

1 Answers1

-1
rpm -ivh --force packagename.rpm

to install the package replacing all existing files.

Zalatik
  • 322
  • 1
  • 7
  • 3
    Not only is this wrong (this command will not cause `rpm` to overwrite existing files), it ignores the actual question asking for how to do this with `yum`. – dossy Jul 29 '20 at 23:46