7

Essentially, I'm using this answer to have a non-interactive experience with application such as dpkg, apt and other ones that may depend on the former.

problem though is, is there any conflict between those two flags, when used together?

I'm asking because, as i understand it:

apt-get -o Dpkg::Options::="--force-confdef"

Use the default setting (depending on package, i believe some either replace old config, and some leave the old one, unless I'm mistaken)

and

apt-get -o Dpkg::Options::="--force-confnew"

Keep the new config instead...

So I'm a bit confused as to why certain sources mention two of these flags, even though they may or may not conflict with each other (tried them but don't know any packages that would launch debconf unless i run dist-upgrade and wait for the right package to do that).

Do i just need a single one of those instead or both?

1 Answer 1

13

This is addressed in the dpkg man page:

confnew: If a conffile has been modified and the version in the package did change, always install the new version without prompting, unless the --force-confdef is also specified, in which case the default action is preferred.

confold: If a conffile has been modified and the version in the package did change, always keep the old version without prompting, unless the --force-confdef is also specified, in which case the default action is preferred.

confdef: If a conffile has been modified and the version in the package did change, always choose the default action without prompting. If there is no default action it will stop to ask the user unless --force-confnew or --force-confold is also been given, in which case it will use that to decide the final action.

--force-confdef on its own will sometimes result in prompting, because a default action isn’t always specified. This can be fixed by adding --force-confnew or --force-confold; when combined with --force-confdef, these don’t replace it, they complement it — the chosen action will be the default, if any, and either the new or old action otherwise (depending on which option was chosen).

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .