How to set up unattended upgrades?

Hi @Aravisian and happy New Year !

After some tests and research, I am almost sure that there is an issue with the update-notifier package, more precisely with the following Python file : /usr/lib/update-notifier/apt_check.py

Normally, when we execute the command /usr/lib/update-notifier/apt-check (which is a link to the Python file apt_check.py), the returned result should have the following format :

TOTAL_NUMBER_OF_UPDATES;NUMBER_OF_SECURITY_UPDATES

For example : 31;0

In Zorin OS 18, with the installed version of the update-notifier package (3.192.68.2), when this command is executed, the returned result contains several warnings before the number of updates, regarding Ubuntu ESM (Expanded Security Maintenance), as follows :

/usr/lib/update-notifier/apt-check:354: Warning: W:Unable to read /var/lib/ubuntu-advantage/apt-esm/etc/apt/apt.conf.d/ - DirectoryExists (2: No such file or directory)
  apt_pkg.init()
/usr/lib/update-notifier/apt-check:362: Warning: W:Unable to read /var/lib/ubuntu-advantage/apt-esm/etc/apt/sources.list.d/ - DirectoryExists (2: No such file or directory), W:Unable to read /var/lib/ubuntu-advantage/apt-esm/etc/apt/sources.list - RealFileExists (2: No such file or directory), W:Unable to read /var/lib/ubuntu-advantage/apt-esm/etc/apt/preferences.d/ - DirectoryExists (2: No such file or directory)
  apt_pkg.init()
31;0

This issue has been fixed in Ubuntu 25.04 (plucky), initially with the version 3.194 of the update-notifier package, as indicated by a contributing developer in this topic : Bug #2064624 “Warning: W:Unable to read /var/lib/ubuntu-advantag...” : Bugs : ubuntu-advantage-tools package : Ubuntu

In Zorin OS 18, by replacing the file /usr/lib/update-notifier/apt_check.py with the one of the version 3.194, after a reboot, the Software Updater GUI is automatically triggered a few moments after opening the session (in this case, if "When there are other updates" = "Display Immediately" in "Software & Updates"), as expected.

Surprisingly, this bugfix is not deployed yet in Ubuntu 24.04. Maybe the Zorin Team can update the update-notifier package for Zorin ?

4 Likes