Preserving the configuration file during RPM update

rpm

I'm trying to make my RPM to preserve configuration files, if these exist.

The behavior should be like MySQL or Lighttpd, where new configuration files, if the old ones are present, are saved with the extension .rpmnew.

Any idea how to best to achieve this?

Best Answer

RPM does this automatically for files marked with the %config attribute in your spec file. Exactly what happens depends on whether the configuration file has been modified locally and whether you have used just %config or %config(noreplace).

Read more here.

Related Topic