[SRU] Gnome Software offers installation of updates on shutdown independently from update-manager and unattended-upgrades

Bug #1775226 reported by Balint Reczey
20
This bug affects 2 people
Affects Status Importance Assigned to Milestone
gnome-software (Ubuntu)
Fix Released
High
Olivier Tilloy
Bionic
Fix Released
High
Olivier Tilloy

Bug Description

[Original Description]

In Ubuntu the GUI for upgrading packages is update-manager allowing debconf questions to be answered when needed and Ubuntu also offers unattended-upgrades for upgrading packages in the background and it keeps back packages from upgrading when configuration-file changes would need user interaction during the upgrade. Unattended-upgrades can be configured to perform upgrades during system shutdown.

Gnome Software in Bionic started offering performing upgrades during shutdown using PackageKit independently from update-manager and unattended-upgrades without offering all of the features of either one.

Unless there is a decision to fully switch to Gnome Software I suggest disabling the "Install pending software updates" on the shutdown screen to avoid confusing users.

[Impact]

As stated in the original description, users may be confused by the checkbox on the shutdown dialog offering to install updates, considering that all updates in Ubuntu are currently handled by a separate GUI (update-manager).

This is fixed in cosmic (3.29.1-0ubuntu6) by disabling offline updates in the packagekit refresh plugin.

The fix is trivial and complements an existing patch that was already disabling updates in gnome-software.

[Test Case]

0) Prerequisite: a bionic system not fully up-to-date (if yours is fully up-to-date, downgrade a package)
1) Verify that the following file doesn't exist (if it does, remove it): /var/lib/PackageKit/prepared-update
2) Open gnome-software
3) Click on the "Updates" tab, and click the refresh button in the top-left corner
4) Wait for the refresh operation to be complete (gnome-software might incorrectly report that there are no updates available, this is a separate issue, bug #1709725)
5) Wait a minute or two to ensure there are no pending packagekit async tasks
6) Verify that /var/lib/PackageKit/prepared-update still doesn't exist, and consequently, when requesting to shut down the computer, the shutdown dialog doesn't offer a "Install pending software updates" checkbox

[Regression Potential]

gnome-software is not used to install updates (from the archive) on Ubuntu. However firmware updates and updates from other packaging systems (such as flatpak) should still appear in the updates tab, when available.

[Other Info]

The updates tab in gnome-software may claim that there are no updates available, when in fact there are. This is also confusing, but is a separate issue (bug #1709725) and will be addressed separately.

Revision history for this message
Balint Reczey (rbalint) wrote :
Revision history for this message
Sebastien Bacher (seb128) wrote :

Thank you for your bug report. What you describe is a bug, we don't have that behaviour/dialog enabled by default. Do you have any non standard packagekit packages/configuration on your installation?
Does it leads to any problem or just to UI confusion? (I saw dialog a few times during the bionic cycle but checking the box didn't seem to do anything)

Changed in gnome-software (Ubuntu):
importance: Undecided → High
Revision history for this message
Sebastien Bacher (seb128) wrote :

It looks like that dialog should be displayed if the "/var/lib/PackageKit/prepared-update" file exists, which is what packagekit used to prepare offline updates. Those shouldn't happen on Ubuntu though. Do you have that file on your disk? What's the timestamp for it?

Revision history for this message
Sebastien Bacher (seb128) wrote :

Googling a bit I found an old Debian discussion on https://lists.debian.org/debian-devel/2015/08/msg00548.html which state that packagekit creates the offline update file when a client requests for one. Did you use gnome-software and if so what did you click in there exactly?

Revision history for this message
Balint Reczey (rbalint) wrote :

I'm sorry, I just upgraded my system and downgraded a package to test latest gnome sw.

The current state is as follows:

$ ls -alh --time-style=full-iso /var/lib/PackageKit/
total 148K
drwxr-xr-x 2 root root 4,0K 2018-07-18 11:15:31.973829737 +0200 .
drwxr-xr-x 65 root root 4,0K 2018-06-21 13:48:53.768046205 +0200 ..
-rw-r--r-- 1 root root 11K 2018-06-05 18:42:56.264000000 +0200 offline-update-competed
-rw-r--r-- 1 root root 128K 2018-07-18 11:15:31.973829737 +0200 transactions.db

$ cat /var/lib/PackageKit/offline-update-competed
[PackageKit Offline Update Results]
Success=true
Role=update-packages
Packages=bsdutils;1:2.31.1-0.4ubuntu3.1;amd64;...

Revision history for this message
Balint Reczey (rbalint) wrote :
Revision history for this message
Balint Reczey (rbalint) wrote :

I don't remember what I did in the past, but I was able to reproduce the dialog with the following steps:
1. Upgrade fully and reboot the system.
2. Downgraded a package:
sudo apt install unattended-upgrades=1.1ubuntu1
3. Disabled u-u:
sudo dpkg-reconfigure unattended-upgrades
4. Opened Gnome Software (Ubuntu Software)
5. Clicked on Updates tab, then on the refresh/reload icon in the upper left corner.
   Gnome Software printed "Looking for updates", then misleadingly that "Software is up to date" despite u-u is still not upgraded.
6. The prepared-update file is now present:
$ ls -alh /var/lib/PackageKit/prepared-update
-rw-r--r-- 1 root root 93 srp 18 12:24 /var/lib/PackageKit/prepared-update
7. Clicking on Shutdown now offers installing updates which is executed, too. Upon next login a report is shown about installed updates.

Revision history for this message
Sebastien Bacher (seb128) wrote :

So from your step it looks like the "key" action is to click on "refresh" in the gnome-software updates tab. If that triggers an offline update in packagekit then we indeed have a bug, we are going to investigate that one.

Changed in gnome-software (Ubuntu):
assignee: nobody → Canonical Desktop Team (canonical-desktop-team)
tags: added: rls-bb-incoming rls-cc-incoming
Will Cooke (willcooke)
Changed in gnome-software (Ubuntu):
assignee: Canonical Desktop Team (canonical-desktop-team) → Olivier Tilloy (osomon)
Revision history for this message
Olivier Tilloy (osomon) wrote :

I can confirm that clicking the refresh button in the title bar in gnome-software's update tab triggers packagekit to write /var/lib/PackageKit/prepared-update, which in turn makes the shutdown dialog offer to install updates before shutting down.

A few observations:

 - contrary to what's stated in comment #2, I observe that ticking the checkbox results in updates being actually installed at shutdown (although I don't know what happens with updates that require user interaction)

 - gnome-software's updates tab says the software is up-to-date, but there are actually 5 package updates available, and they are listed in /var/lib/PackageKit/prepared-update

 - during my tests in a bionic VM, I also observed once that prepared-update file being created without interaction with gnome-software: I simply ran "sudo apt update" in a terminal window, then requested shutdown, and the dialog offered to install updates, so something else also triggered packagekit

Changed in gnome-software (Ubuntu):
status: New → Confirmed
Olivier Tilloy (osomon)
Changed in gnome-software (Ubuntu):
status: Confirmed → In Progress
Revision history for this message
Olivier Tilloy (osomon) wrote :

> during my tests in a bionic VM, I also observed once that
> prepared-update file being created without interaction with
> gnome-software: I simply ran "sudo apt update" in a terminal window,
> then requested shutdown, and the dialog offered to install updates,
> so something else also triggered packagekit

I am able to reproduce that behaviour rather reliably in a cosmic VM, and this doesn't happen if I kill gnome-software that's running as a daemon, so it looks like gnome-software is the culprit in that case too.

Revision history for this message
Iain Lane (laney) wrote :

Thanks for the investigations. It's probably debian/patches/0006-packagekit-Disable-updates.patch not being complete enough. Maybe it's gs_plugin_refresh in plugins/packagekit/gs-plugin-packagekit-refresh.c that also needs a return TRUE?

Revision history for this message
Olivier Tilloy (osomon) wrote :

Yes, if we return early in gs_plugin_refresh in plugins/packagekit/gs-plugin-packagekit-refresh.c just after refreshing the metadata (i.e. if we skip downloading updates), the prepared-update file is never written, so that appears to be what we want.

Revision history for this message
Olivier Tilloy (osomon) wrote :
Revision history for this message
Launchpad Janitor (janitor) wrote :

This bug was fixed in the package gnome-software - 3.29.1-0ubuntu6

---------------
gnome-software (3.29.1-0ubuntu6) cosmic; urgency=medium

  * debian/patches/0006-packagekit-Disable-updates.patch:
    - also disable offline updates in refresh plugin (LP: #1775226)

 -- Olivier Tilloy <email address hidden> Wed, 01 Aug 2018 11:58:58 +0200

Changed in gnome-software (Ubuntu):
status: In Progress → Fix Released
Olivier Tilloy (osomon)
Changed in gnome-software (Ubuntu Bionic):
assignee: nobody → Olivier Tilloy (osomon)
status: New → In Progress
importance: Undecided → High
Olivier Tilloy (osomon)
summary: - Gnome Software offers installation of updates on shutdown independently
- from update-manager and unattended-upgrades
+ [SRU] Gnome Software offers installation of updates on shutdown
+ independently from update-manager and unattended-upgrades
description: updated
Revision history for this message
Łukasz Zemczak (sil2100) wrote :

There is an ongoing bionic SRU in bionic-proposed still. Please help verifying it as without it release we can not proceed with reviewing this upload.

Revision history for this message
Łukasz Zemczak (sil2100) wrote : Please test proposed package

Hello Balint, or anyone else affected,

Accepted gnome-software into bionic-proposed. The package will build now and be available at https://launchpad.net/ubuntu/+source/gnome-software/3.28.1-0ubuntu4.18.04.3 in a few hours, and then in the -proposed repository.

Please help us by testing this new package. See https://wiki.ubuntu.com/Testing/EnableProposed for documentation on how to enable and use -proposed.Your feedback will aid us getting this update out to other Ubuntu users.

If this package fixes the bug for you, please add a comment to this bug, mentioning the version of the package you tested and change the tag from verification-needed-bionic to verification-done-bionic. If it does not fix the bug for you, please add a comment stating that, and change the tag to verification-failed-bionic. In either case, without details of your testing we will not be able to proceed.

Further information regarding the verification process can be found at https://wiki.ubuntu.com/QATeam/PerformingSRUVerification . Thank you in advance!

Changed in gnome-software (Ubuntu Bionic):
status: In Progress → Fix Committed
tags: added: verification-needed verification-needed-bionic
Balint Reczey (rbalint)
tags: added: verification-done-bionic
removed: verification-needed-bionic
tags: added: verification-done
removed: verification-needed
Revision history for this message
Balint Reczey (rbalint) wrote :

Verified with 3.28.1-0ubuntu4.18.04.3.

Revision history for this message
Olivier Tilloy (osomon) wrote :

Thanks for confirming the fix Balint!

Revision history for this message
Łukasz Zemczak (sil2100) wrote : Update Released

The verification of the Stable Release Update for gnome-software has completed successfully and the package has now been released to -updates. Subsequently, the Ubuntu Stable Release Updates Team is being unsubscribed and will not receive messages about this bug report. In the event that you encounter a regression using the package from -updates please report a new bug using ubuntu-bug and tag the bug report regression-update so we can easily find any regressions.

Revision history for this message
Launchpad Janitor (janitor) wrote :

This bug was fixed in the package gnome-software - 3.28.1-0ubuntu4.18.04.3

---------------
gnome-software (3.28.1-0ubuntu4.18.04.3) bionic; urgency=medium

  * debian/patches/0006-packagekit-Disable-updates.patch:
    - also disable offline updates in refresh plugin (LP: #1775226)

 -- Olivier Tilloy <email address hidden> Thu, 02 Aug 2018 12:25:36 +0200

Changed in gnome-software (Ubuntu Bionic):
status: Fix Committed → Fix Released
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Duplicates of this bug

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.