2

In Ubuntu 16/18 I would like to set unattended-upgrades to yes non-interactively.

I only know about dpkg-reconfigure unattended-upgrades and it isn't.

Is this possible and how?

Marco
  • 186
  • 1
  • 9

2 Answers2

2

Check the file /etc/apt/apt.conf.d/20auto-upgrades

Look for the following line:

APT::Periodic::Unattended-Upgrade "1";

'1' means enabled, '0' means disabled. Edit the config file to the setting you want.

user535733
  • 62,253
1
sudo EDITOR='sed -Ei "
    s|unattended-upgrades/enable_auto_updates=.+|unattended-upgrades/enable_auto_updates=\"no\"|
    "' dpkg-reconfigure -f editor unattended-upgrades

Related answer: How do you set a locale non-interactively on Debian/Ubuntu?