4

Regarding configuration of Unattended-Upgrades:

  1. Which are the appropriate files for configuring each option of Unattended-Upgrades?
    I have seen three files mentioned, see below. I am not certain others could also be used.

  2. Can any of the files above be used for any of the options, or there is a restriction on this? (There is some overlap, for sure, see below).

  3. Which has precedence for repeated options?

PS: These are actually different questions, but intimately related, so it would be possibly less convenient to separate them into different posts.

What I see in my 18.04LTS:

$ cat /etc/apt/apt.conf.d/20auto-upgrades 
APT::Periodic::Update-Package-Lists "1";
APT::Periodic::Unattended-Upgrade "1";
$ cat /etc/apt/apt.conf.d/10periodic 
APT::Periodic::Update-Package-Lists "1";
APT::Periodic::Download-Upgradeable-Packages "0";
APT::Periodic::AutocleanInterval "0";
$ cat /etc/apt/apt.conf.d/50unattended-upgrades
(long output)

PS2: As for how to configure or disable, these are related

Limiting the time Unattended-Upgrade keeps the lock on `/var/lib/dpkg/`

Ubuntu 16.04: Unattended-upgrades runs at random times

Unattended-upgrades running for hours

Disable automatic updates ubuntu 18.04

disable updates from command line in Ubuntu 16.04

Disable Software Updater Notification?

How to Enable/Disable Unattended Upgrades in Ubuntu 16.04

Terminate and disable/remove unattended upgrade before command returns

  • Seems clear to me what each does, and dpkg will happily tell you which packages provide each file. Files are processed in numeric order - later files overrule earlier. You can place any option anywhere you wish. Do you have a specific question? – user535733 Apr 13 '20 at 19:30
  • @user535733 - I have specific questions, and your helped better ordering them, please see edit. Your answer (in a comment) was concise. If I understand correctly, this is what you mean, please comment:
    1. You didn't specify all configuration files associated with Unattended-Upgrade.
    2. Yes. In fact, strictly speaking any file under /etc/apt/apt.conf.d could contain any configuration option for unattended-upgrade, and they would be equally processed. The decision on where to place them helps organization, and accounting for the precedence.
    3. Files are processed in alphabetical order.
    – sancho.s ReinstateMonicaCellio Apr 13 '20 at 19:49

1 Answers1

1

As for the precedence of the configurations files, see this question

/etc/apt/apt.conf.d/10periodic is related to update-notifier-common package. Same setting variables that are set in /etc/apt/apt.conf.d/20auto-upgrades will override those settings. You can setup the 20auto-upgrades file by running sudo dpkg-reconfigure unattended-upgrades. If you use the GUI way i.e. "Software & Updates" dialog i.e. /usr/bin/software-properties-gtk (its Updates tab), it will change both files. As for scheduling unattended-upgrades, I suppose it goes the same way as with Debian; see this question.

You should not modify /etc/apt/apt.conf.d/50unattended-upgrades. Instead, use files starting with e.g. "51" to override some of the settings:

To override the configuration it is recommended to create an other APT configuration file fragment which overrides the shipped default value because updates to to shipped configuration file may conflict with the local changes blocking updating unattended-upgrades itself. The new file should sort later than 50unattended-upgrades to be parsed later than the one shipping the default values, it can be e.g. 52unattended-upgrades-local.

Reference: https://github.com/mvo5/unattended-upgrades/blob/master/README.md

jarno
  • 5,600