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

@AZorin and @zorink may be able to review your results above to see if it can apply to Zorin OS 18.

3 Likes

@guugues thanks for identifying this solution!

After some research and inspection, we just released an update to the update-notifier which includes this change to the apt_check.py file as a backported patch in Zorin OS 18.
As a result, this issue should be resolved after installing the latest updates from the Software Updater today.

I can also confirm that this update should ensure that the Software Updater will automatically open (minimised in the taskbar) when updates are available. This is set to happen once a week by default, but you can adjust the schedule by opening the Zorin menu > search & open "Software & Updates" > Updates and changing the "When there are other updates" option to "Display immediately".

6 Likes

One question: when will the update be online?

1 Like

The update was published a couple of hours ago, so you should be able to install it from the Software Updater now.

2 Likes

Okay, thank you. Then it was probably installed earlier in the update.

@AZorin You're welcome ! :slightly_smiling_face:

I just have a question regarding the following point :

Is it really relevant to open the Sofware Updater minimised ? In Zorin OS 17, it was fully displayed.

I think it should also be the case in Zorin OS 18 (especially as I am not sure that the average man will always notice the Software Updater icon in the taskbar and click on it to open the GUI).

Ok now I had some time to test and let the vm run for a few hours. Looks like unattended upgrades work now.

Start-Date: 2026-01-07  19:16:01
Commandline: /usr/bin/unattended-upgrade
Upgrade: libjavascriptcoregtk-4.1-0:amd64 (2.50.2-0ubuntu0.24.04.2, 2.50.3-0ubuntu0.24.04.1), gir1.2-javascriptcoregtk-4.1:amd64 (2.50.2-0ubuntu0.24.04.2, 2.50.3-0ubuntu0.24.04.1), gir1.2-javascriptcoregtk-6.0:amd64 (2.50.2-0ubuntu0.24.04
.2, 2.50.3-0ubuntu0.24.04.1), gir1.2-webkit2-4.1:amd64 (2.50.2-0ubuntu0.24.04.2, 2.50.3-0ubuntu0.24.04.1), libjavascriptcoregtk-6.0-1:amd64 (2.50.2-0ubuntu0.24.04.2, 2.50.3-0ubuntu0.24.04.1), libwebkit2gtk-4.1-0:amd64 (2.50.2-0ubuntu0.24.
04.2, 2.50.3-0ubuntu0.24.04.1), gir1.2-webkit-6.0:amd64 (2.50.2-0ubuntu0.24.04.2, 2.50.3-0ubuntu0.24.04.1), libwebkitgtk-6.0-4:amd64 (2.50.2-0ubuntu0.24.04.2, 2.50.3-0ubuntu0.24.04.1)
End-Date: 2026-01-07  19:16:04

Start-Date: 2026-01-07  19:16:07
Commandline: /usr/bin/unattended-upgrade
Upgrade: libglib2.0-bin:amd64 (2.80.0-6ubuntu3.5, 2.80.0-6ubuntu3.6), gir1.2-glib-2.0:amd64 (2.80.0-6ubuntu3.5, 2.80.0-6ubuntu3.6), libglib2.0-data:amd64 (2.80.0-6ubuntu3.5, 2.80.0-6ubuntu3.6), libglib2.0-0t64:amd64 (2.80.0-6ubuntu3.5, 2.
80.0-6ubuntu3.6)
End-Date: 2026-01-07  19:16:10

Start-Date: 2026-01-07  19:16:13
Commandline: /usr/bin/unattended-upgrade
Upgrade: libcaca0:amd64 (0.99.beta20-4build2, 0.99.beta20-4ubuntu0.1)
End-Date: 2026-01-07  19:16:13

Start-Date: 2026-01-08  15:00:11
Commandline: /usr/bin/unattended-upgrade
Upgrade: gpg:amd64 (2.4.4-2ubuntu17.3, 2.4.4-2ubuntu17.4), keyboxd:amd64 (2.4.4-2ubuntu17.3, 2.4.4-2ubuntu17.4), gnupg:amd64 (2.4.4-2ubuntu17.3, 2.4.4-2ubuntu17.4), gpg-agent:amd64 (2.4.4-2ubuntu17.3, 2.4.4-2ubuntu17.4), gpgv:amd64 (2.4.4
-2ubuntu17.3, 2.4.4-2ubuntu17.4), gpgsm:amd64 (2.4.4-2ubuntu17.3, 2.4.4-2ubuntu17.4), dirmngr:amd64 (2.4.4-2ubuntu17.3, 2.4.4-2ubuntu17.4), gnupg-utils:amd64 (2.4.4-2ubuntu17.3, 2.4.4-2ubuntu17.4), gpg-wks-client:amd64 (2.4.4-2ubuntu17.3,
 2.4.4-2ubuntu17.4), gpgconf:amd64 (2.4.4-2ubuntu17.3, 2.4.4-2ubuntu17.4)
End-Date: 2026-01-08  15:00:14

Start-Date: 2026-01-08  15:00:16
Commandline: /usr/bin/unattended-upgrade
Upgrade: libsnmp-base:amd64 (5.9.4+dfsg-1.1ubuntu3.1, 5.9.4+dfsg-1.1ubuntu3.2), libsnmp40t64:amd64 (5.9.4+dfsg-1.1ubuntu3.1, 5.9.4+dfsg-1.1ubuntu3.2)
End-Date: 2026-01-08  15:00:18

Start-Date: 2026-01-08  15:00:20
Commandline: /usr/bin/unattended-upgrade
Upgrade: libxslt1.1:amd64 (1.1.39-0exp1ubuntu0.24.04.2, 1.1.39-0exp1ubuntu0.24.04.3)
End-Date: 2026-01-08  15:00:20
2026-01-07 19:15:46,427 INFO Starting unattended upgrades script
2026-01-07 19:15:46,428 INFO Allowed origins are: o=Ubuntu,a=noble, o=Ubuntu,a=noble-security, o=UbuntuESMApps,a=noble-apps-security, o=UbuntuESM,a=noble-infra-security
2026-01-07 19:15:46,428 INFO Initial blacklist:
2026-01-07 19:15:46,428 INFO Initial whitelist (not strict):
2026-01-07 19:16:00,712 INFO Packages that will be upgraded: gir1.2-glib-2.0 gir1.2-javascriptcoregtk-4.1 gir1.2-javascriptcoregtk-6.0 gir1.2-webkit-6.0 gir1.2-webkit2-4.1 libcaca0 libglib2.0-0t64 libglib2.0-bin libglib2.0-data libjavascr
iptcoregtk-4.1-0 libjavascriptcoregtk-6.0-1 libwebkit2gtk-4.1-0 libwebkitgtk-6.0-4
2026-01-07 19:16:00,712 INFO Writing dpkg log to /var/log/unattended-upgrades/unattended-upgrades-dpkg.log
2026-01-07 19:16:15,265 INFO All upgrades installed
2026-01-07 19:16:15,561 INFO Package gnome-tour is kept back because a related package is kept back or due to local apt_preferences(5).
2026-01-08 00:49:30,120 INFO Starting unattended upgrades script
2026-01-08 00:49:30,120 INFO Allowed origins are: o=Ubuntu,a=noble, o=Ubuntu,a=noble-security, o=UbuntuESMApps,a=noble-apps-security, o=UbuntuESM,a=noble-infra-security
2026-01-08 00:49:30,120 INFO Initial blacklist:
2026-01-08 00:49:30,120 INFO Initial whitelist (not strict):
2026-01-08 15:00:01,345 INFO Starting unattended upgrades script
2026-01-08 15:00:01,345 INFO Allowed origins are: o=Ubuntu,a=noble, o=Ubuntu,a=noble-security, o=UbuntuESMApps,a=noble-apps-security, o=UbuntuESM,a=noble-infra-security
2026-01-08 15:00:01,345 INFO Initial blacklist:
2026-01-08 15:00:01,345 INFO Initial whitelist (not strict):
2026-01-08 15:00:10,511 INFO Packages that will be upgraded: dirmngr gnupg gnupg-utils gpg gpg-agent gpg-wks-client gpgconf gpgsm gpgv keyboxd libsnmp-base libsnmp40t64 libxslt1.1
2026-01-08 15:00:10,511 INFO Writing dpkg log to /var/log/unattended-upgrades/unattended-upgrades-dpkg.log
2026-01-08 15:00:22,167 INFO All upgrades installed
2026-01-08 15:00:22,435 INFO Package gnome-tour is kept back because a related package is kept back or due to local apt_preferences(5).

@AZorin It would be good to have some continuous testing for these essential functionalities(maybe a vm, that gets restarted periodically), who knows when canonical will change something that will break something in zorin again. I consider unattended-upgrades essential, there might be more. I'm pretty sure this was broken for months.

For an average user, updates are a foreign concept, they don't understand their purpose, for them windows updates are just a useless unavoidable nuisance, nothing more. There are millions of windows 10 users who will use it for another decade, because it just does what they need it to do, they don't care if they're part of a botnet...

Also at least a blog post would be nice if the users need to perform a manual update to get fixes and keep getting updates automatically.

@guugues No one likes pop-ups, also who doesn't care about a notification is not going to care about a pop up either.

I don't think that's true:


I tried changing the 'subcribed to' to everything but it keeps reverting to custom. So that's not it either.

I can't figure out how to have the "other updates" automatically installed in the background.

I basically want a 'user never sees any update prompts' and it all happens in the background and just auto reboots during sunday night with a cron job.

Happened in my vm too. I was installing it with BIOS, for some reason when I reinstalled it with UEFI it worked as you would expect. Not sure if that's the cause, but might worth a try if it's possible.