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

Re: dpkg and conffiles



Rafael Laboissiere wrote:
> I am trying to understand how _exactly_ dpkg handles those *.dpkg-new and
> *.dpkg-dist files during package installation.  More precisely, I wish to
> know how (and under which conditions) dpkg creates/renames/deletes those
> files.  I could go through the code in main/configure.c, but it is quite
> unreadable for me.  Is there any documentation available, or could somebody 
> enlighten me, please?

You may find usr/doc/packaging-manual/packaging.html/ch-conffiles.html
useful, unfortunatly, it doesn't go into details about the -{dist,new,old}
files. Here's what I know from experience (corrections appreciated, this is
quite off the cuff).

When a package is unpacked onto a system, and not yet configured, dpkg
used the .dpkg-new prefix for all of its conffiles.

When the package is configured, dpkg will prompt the user if necessary for
what to do with the conffiles. If a new conffile replaces a user's old
conffile, dpkg renames the old conffile .dpkg-old and moves the .dpkg-new
into place. If not, it renames the .dpkg-new to .dpkg-dist.

When a package is removed from a system, the conffiles are not touched.

When a package is purged, the conffiles are deleted, as are the .dpkg-*
files, if any.

(Interestingly, this transcript seems to show dpkg deleting file~ backup
files in a purge. Odd.

root@kite:~>ls -l /etc/lynx*  
-rw-r--r--   1 root     root        65917 May  3 16:59 /etc/lynx.cfg
-rw-r--r--   1 root     root        78031 May 11 18:10 /etc/lynx.cfg.dpkg-dist
-rw-r--r--   1 root     root        65917 Mar  8 18:53 /etc/lynx.cfg~
root@kite:~>dpkg --purge lynx
(Reading database ... 65519 files and directories currently installed.)
Removing lynx ...
Purging configuration files for lynx ...
root@kite:~>ls -l /etc/lynx*
zsh: no matches found: /etc/lynx*

)

-- 
see shy jo


Reply to: