1

I have a custom Debian package that creates a touch-screen calibration file and will be deployed for automatic updating. I want to preserve the calibration file if the user has changed it, so my new version of the package has declared this file a "conffile".

The issue is that upon the upgrade to my new version of the package there will be a "conffile" dialog

Configuration file `/etc/penmount/penmount.dat'
==> Modified (by you or by a script) since installation.
==> Package distributor has shipped an updated version.
  What would you like to do about it ?  Your options are:
  Y or I  : install the package maintainer's version
  N or O  : keep your currently-installed version
  D     : show the differences between the versions
  Z     : start a shell to examine the situation
The default action is to keep your current version.
*** bash.bashrc (Y/I/N/O/D/Z) [default=N] ? 

I can answer this automatically by creating a /etc/apt/apt.conf/local file with the content:

Dpkg::Options {
   "--force-confdef";
   "--force-confold";
}

My approach has been to create this local and install it with another package and then use a Pre-Depends to get this package installed before the upgrade of the package with the conffile.

Howver, when I do a dist-upgrade both packages get installed, but the install is halted by dialog above. If I install the package that sets the Dpkg options first followed by an install of my "conffile" package the questions are handled automatically.

How to mark an existing configuration file as a conffile and do an automatic update in one pass?

  • You can drop files into /etc/profile.d. Wouldn't that be simpler than modifying bash.bashrc? – muru Jul 16 '14 at 15:05
  • I edited the "conffile" dialog to better match my problem. It is not related to bashrc issues. – user2814956 Jul 16 '14 at 21:12

Your Answer

By clicking "Post Your Answer", you acknowledge that you have read our updated terms of service, privacy policy and cookie policy, and that your continued use of the website is subject to these policies.

Browse other questions tagged or ask your own question.