[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: What happens when you upgrade a package with modified config files?



On Tue, Jan 08, 2013 at 03:42:30PM +0000, David Guntner wrote:
> Hi, all.
> 
> Back in the days when I was using Mandriva (which RPM-based), when I
> updated a package that had a configuration file that I had modified,
> urpmi was smart enough to realize it, and wouldn't just blindly wipe it
> out.  Instead, it would create a new copy for you to look over and
> merge.  I.E., you'd end up with something like:
> 
> /etc/somepackage.conf.rpmnew

Yuck!

> Then after doing the update, I could look for files with .rpmnew at the
> end and work on making any changes needed.  Heck, we even had a really
> handy script called etc-update which would go through the /etc directory
> looking for .rpmnew files and would then give you the choice of use the
> new file, keep the old file (& delete the new one) or merge the two
> together, which would diff the two and present the changes in groups
> side-by-side and you'd then select to use the left side (original
> content) or use the right side (the new content in the .rpmnew file) and
> you'd go through that until you were done.

Sounds like my experience of redhat... the bad old days.

> 
> Regardless of an etc-update like tool, is that how it works in Debian?
> Does it avoid overwriting config files which have been changed by you
> since they were installed, and if so, does it put the new content with
> an easy-to-search-for .something at the end?

Unless the package maintainer tries to do something fancy and gets it
wrong, Debian will by default do the "right thing" when dealing with
configuration files - gory details at

  http://www.debian.org/doc/debian-policy/ap-pkg-conffiles.html

In my experience:

- If you have not modified the configuration, the new config will be
  substituted.

- If you *have* modified the configuration, most interfaces will give
  you a diff between your current configuration and ask what to do.  I
  typically open up a different session and use vim/emacs to merge the
  two sets of changes at this point.

Hope this helps

-- 
Karl E. Jorgensen


Reply to: