Server Fault is a question and answer site for system and network administrators. It's 100% free, no registration required.

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I've got an RPM that overlays particular files delivered by another package. What I'd like to do is tell RPM "if 'directory/file' exists and you're about to overwrite it, rename it to "filename.backup" first.

It doesn't look like %pre gets to know which %files are delivered by the RPM. Is there a way or keeping backups of original files that I'm missing?

share|improve this question

This is a bad idea. What happens when the initial package gets updated? Your changes are likely to get reverted.

I'd try to repackage the initial package with your edits versus trying to fold another package on top of the original.

Sorry if this doesn't answer your question directly but something for you to consider.

See also, config files, noreplace, etc:

share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

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