Unattended-upgrades vs. DEBIAN_FRONTEND=noninteractive apt-get upgrade vs. apt-get upgrade -y

Today I ran a manual upgrade via the command line, and despite using the DEBIAN_FRONTEND=noninteractive environment variable I still received a couple of configuration prompts (e.g., matrix-synapse). I was a bit surprised and simply accepted the default responses, which led me to wonder the following:

  • Why did I receive the configuration prompts despite the DEBIAN_FRONTEND=noninteractive environment variable?

  • In terms of the state of the system after an upgrade, what is the difference between upgrades with unattended-upgrades and upgrades with the DEBIAN_FRONTEND=noninteractive environment variable?

  • What is the difference between upgrades with the DEBIAN_FRONTEND=noninteractive environment variable and simply accepting the default responses (e.g., ’ "Do you want to continue [y/N]?’ answered with N)?

  • What is the -y option (i.e., automatic β€˜yes’ to prompts)? Does the -y tag mean always answer yes (e.g., ’ "Do you want to continue [y/N]?’ would be answered with y) or always answer with the default response (e.g., ’ "Do you want to continue [y/N]?’ would be answered with N)?

Just curious.

  • DEBIAN_FRONTEND is an option for debconf. It doesn’t affect apt / dpkg overall.
  • unattended-upgrades will not upgrade packages that have a conffile prompt. This is a good thing, because we often release new versions of FreedomBox to properly handle conffile prompts. FreedomBox will check for packages to be upgraded on a regular basis.
  • Note that sometimes selecting β€œN” will not work. The old configuration may not be compatible with the new package.
  • I’m not sure about this one.
1 Like