Skip to content

Instantly share code, notes, and snippets.

@rafaelmaeuer
Last active August 9, 2024 12:14
Show Gist options
  • Save rafaelmaeuer/87607c43a0d9549abb262b7b2ea0319a to your computer and use it in GitHub Desktop.
Save rafaelmaeuer/87607c43a0d9549abb262b7b2ea0319a to your computer and use it in GitHub Desktop.

You can pass arguments to avoid getting prompts. This works for me;

apt-get update
apt-get --yes --force-yes -o Dpkg::Options::="--force-confdef" -o Dpkg::Options::="--force-confold" upgrade
apt-get --yes --force-yes -o Dpkg::Options::="--force-confdef" -o Dpkg::Options::="--force-confold" dist-upgrade

--force-confold (my choice) will make these "What do you want to do about modified configuration file" questions default to N (keep your currently-installed version)

--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.
--force-confnew: always install the new version of the configuration file, the current version is kept in a file with the .dpkg-old suffix.
--force-confdef: ask dpkg to decide alone when it can and prompt otherwise. This is the default behavior of dpkg and this option is mainly useful in combination with --force-confold.
--force-confmiss: ask dpkg to install the configuration file if it’s currently missing (for example because you have removed the file by mistake).
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment