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}

  • 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. – Ramhound Mar 6 '19 at 22:30
  • I'm not sure I understand you, @Ramhound: where do you suggest I use -force? In yum reinstall? – boardrider Mar 6 '19 at 22:43
rpm -ivh --force packagename.rpm

to install the package replacing all existing files.

  • 2
    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

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.