Juan Reina Pascual
Juan Reina Pascual

Reputation: 4588

yum upgrade does not save old file

I have two file mark with the directive %config:

1- When I do: yum erase my_rpm the files are saved but

2- When I do: yum upgrade my_rpm the files are overwritten

How can I save my files when I use yum upgrade.

Update info:

After install my rpm I edit and save the files marked with the config directive. Then I do yum upgrade my_rpm and the files are not saved neither overwritten.

e.g.

file content before install: value=1
file content after install(edited): value=2
file content after upgrade: value=2

I would expect:

file content before install: value=1
file content after install(edited): value=2
after upgrade two files:
      1. file saved with value=2
      2. new file with value=1

When I do: yum erase the files are saved

Update 2:

After re-read the rpm/spec documentation, upgrade was work fine. if the file marked with config in the rpm new and rpm old are equals and the changes are in my local the upgrade will do a merge.

Sorry for the inconvenience.

Upvotes: 0

Views: 413

Answers (1)

Chris Maes
Chris Maes

Reputation: 37732

Consider using the %config(noreplace) directive:

%config(noreplace) /path/to/config-file

Here is a very helpful site on what that means when you upgrade.

Upvotes: 3

Related Questions