Can I have dpkg-reconfigure ignore, and not ask user to keep local modified or install maintainers version of a specific config file or for a specific pkg?
We're configuring our clients with ansible, but when the users run apt upgrade and a pkg is updated which contains any of the config files that we've modified for our environment, the user faces the question whether to keep the local, modified version or install the maintainers version of the file.
It would be nice if we somehow could configure [dpkg|apt] to not ask about these files and always choose to keep the local, modified version.
Is this possible? How?
Scheduled Maintenance: We are aware of an issue with Google, AOL, and Yahoo services as email providers which are blocking new registrations. We are trying to fix the issue and we have several internal and external support tickets in process to resolve the issue. Please see: viewtopic.php?t=158230
Can I have dpkg-reconfigure ignore a specific pkg/config-file?
Re: Can I have dpkg-reconfigure ignore a specific pkg/config-file?
Seems like Raphaël Hertzog had the answer in a comment on https://raphaelhertzog.com/2010/09/21/d ... -by-dpkg/:
Unfortunately no. In most cases, dpkg is configured to install unmodified configuration files and those that were already modified are managed by an external tool like puppet or cfengine anyway.
- fabien
- Forum Helper
- Posts: 667
- Joined: 2019-12-03 12:51
- Location: Anarres (Toulouse, France actually)
- Has thanked: 61 times
- Been thanked: 153 times
Re: Can I have dpkg-reconfigure ignore a specific pkg/config-file?
Thank you for Raphaël Hertzog's article. Don't you think this could solve your problem?
As I understand it, only non-locally modified files are overwritten, hence debconf shouldn't prompt the user for locally modified files I guess.--force-confold: do not modify the current configuration file, the new version is installed with a .dpkg-dist suffix. With this option alone, even configuration files that you have not modified are left untouched. You need to combine it with --force-confdef to let dpkg overwrite configuration files that you have not modified.
[...]
If you use Apt, you can pass options to dpkg with a command-line like this:
$ apt-get -o Dpkg::Options::="--force-confdef" -o Dpkg::Options::="--force-confold" dist-upgrade
You can also make those options permanent by creating /etc/apt/apt.conf.d/local:
Dpkg::Options {
"--force-confdef";
"--force-confold";
}
Re: Can I have dpkg-reconfigure ignore a specific pkg/config-file?
See my quoted text above, where he answers the question:
With:Thanks for this doc. Is there a way to specify on which file those –force-conf* options apply? Like –force-confold=/etc/samba/smb.conf.
So I'd say no for specific files/pkgs, but probably for the entire OS, but that's not what I want...Unfortunately no. In most cases, dpkg is configured to install unmodified configuration files and those that were already modified are managed by an external tool like puppet or cfengine anyway.