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?

If none of the specific sub-forums seem right for your thread, ask here.
Post Reply
Message
Author
User avatar
jby
Posts: 13
Joined: 2022-01-18 13:39
Contact:

Can I have dpkg-reconfigure ignore a specific pkg/config-file?

#1 Post by jby »

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?

User avatar
jby
Posts: 13
Joined: 2022-01-18 13:39
Contact:

Re: Can I have dpkg-reconfigure ignore a specific pkg/config-file?

#2 Post by jby »

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.

User avatar
fabien
Forum Helper
Forum Helper
Posts: 620
Joined: 2019-12-03 12:51
Location: Anarres (Toulouse, France actually)
Has thanked: 60 times
Been thanked: 146 times

Re: Can I have dpkg-reconfigure ignore a specific pkg/config-file?

#3 Post by fabien »

Thank you for Raphaël Hertzog's article. Don't you think this could solve your problem?
--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";
}
As I understand it, only non-locally modified files are overwritten, hence debconf shouldn't prompt the user for locally modified files I guess.

User avatar
jby
Posts: 13
Joined: 2022-01-18 13:39
Contact:

Re: Can I have dpkg-reconfigure ignore a specific pkg/config-file?

#4 Post by jby »

See my quoted text above, where he answers the question:
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.
With:
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.
So I'd say no for specific files/pkgs, but probably for the entire OS, but that's not what I want...

Post Reply