Perform an apt update if there is no appstream available

Bug #1554023 reported by Iain Lane
14
This bug affects 2 people
Affects Status Importance Assigned to Milestone
gnome-software (Ubuntu)
Fix Released
Medium
William Hua
livecd-rootfs (Ubuntu)
Fix Released
Medium
Iain Lane

Bug Description

appstream's IndexTarget doesn't take effect until the first 'apt update' after it is installed. This means you get no installed software after first installing g-s until you update again.

I tried to ask apt's developers if they could see a way to fix this but on first reply they deny there is a problem at all.

  http://comments.gmane.org/gmane.linux.debian.apt.devel/30085

So I think we have to workaround the problem somehow. First strawman: have gnome-software do an 'update' on first launch if it finds no appstream metadata and /etc/apt/apt.conf.d/50appstream is installed.

We also need to fix this in livecd-rootfs for new installs. I guess there we can add a hook to do an update as part of the build.

Iain Lane (laney)
Changed in livecd-rootfs (Ubuntu):
status: New → In Progress
assignee: nobody → Iain Lane (laney)
Revision history for this message
Iain Lane (laney) wrote :

Actually we already do this update for the live system :).

Try with inkscape or fontforge which are both in main but not on the system.

Changed in livecd-rootfs (Ubuntu):
status: In Progress → Fix Released
William Hua (attente)
Changed in gnome-software (Ubuntu):
assignee: nobody → William Hua (attente)
Revision history for this message
William Hua (attente) wrote :

Just trying to think through what the correct approach is here. Is there a reason why are we going through appstream to get the list of packages instead of looking directly in /var/lib/apt/lists and /var/lib/dpkg/status for the package info? The apt plugin is already somewhat doing this (I'm assuming apt/dpkg still properly update /var/lib/* after installation without needing an update, but I'm not sure).

Revision history for this message
Matthias Klumpp (ximion) wrote :

1) The app-info locations are standardized and can't be changed because tools might rely on it
2) Same applies to the Xapian cache
3) APT will not maintain the AppStream data - it will only download the data
4) The icons need to be extracted correctly and the YAML needs to be (partially) parsed for the origin entry. Those are things the APT team will not allow in APT itself (I asked).

So basically, APT is only for downloading, all the heavy lifting is done by appstream(cli).
Good thing is that you only need to trigger an apt update to get all metadata updated instantly, we handle all the magic transparently in the background.

So ideally, if no metadata is detected (not-installed application count is zero or close to zero), redirect user to the update page and inform him that an update will be performed in the background. Call the Refresh() action on PK or the tool interfacing with APT.

Revision history for this message
William Hua (attente) wrote :

Ah, makes sense, thanks for the explanation!

> So ideally, if no metadata is detected (not-installed application count is zero or close to zero)

How do we define close to zero? On my system, there are 5 apps that always seem to have AS_APP_STATE_UNKNOWN:

gs_plugin_appstream_startup: 8: 'UEFI-dummy-dev0' ('UEFI Updates'): 0
gs_plugin_appstream_startup: 9: 'com.via.VL811.firmware' ('VL811 Firmware'): 0
gs_plugin_appstream_startup: 10: 'com.via.VL811+.firmware' ('VL811+ Firmware'): 0
gs_plugin_appstream_startup: 11: 'com.via.VL812.firmware' ('VL812 Firmware'): 0
gs_plugin_appstream_startup: 12: 'com.via.VL812_B2.firmware' ('VL812 B2 Firmware'): 0

So I'm not really sure how to precisely define when an apt update is required or not.

Changed in gnome-software (Ubuntu):
status: New → In Progress
Revision history for this message
Matthias Klumpp (ximion) wrote :

Also check for the component type then (should be of type DESKTOP_APP)... It's a bit dirty though, because people will maybe not want metadata but still want to use GS...
So probably checking if /var/lib/app-info/yaml contains files and /etc/apt/apt.conf.d/50appstream is present will be the better approach.

Revision history for this message
Matthias Klumpp (ximion) wrote :

Hmm, while thinking about it, since GS depends on it, the file in /etc/apt will always be present... So that check could just be omitted, even...

Changed in gnome-software (Ubuntu):
importance: Undecided → Medium
Changed in livecd-rootfs (Ubuntu):
importance: Undecided → Medium
Revision history for this message
Launchpad Janitor (janitor) wrote :

This bug was fixed in the package gnome-software - 3.19.93~git20160318.55deb24-0ubuntu1

---------------
gnome-software (3.19.93~git20160318.55deb24-0ubuntu1) xenial; urgency=medium

  * New upstream snapshot
  * debian/control:
    - Add Vcs-Bzr link
  * debian/ubuntu-one.png:
    - Move binary file from ubuntu-review-submit.patch into packaging
  * debian/patches/apt-plugin.patch:
    - Fix crash when authentication denied (LP: #1549890)
    - Fix changelog URL
    - Fix typo (LP: #1557213)
  * debian/patches/fwupd-error.patch:
    - Handle fwupd not existing (LP: #1558816)
  * debian/patches/appstream-refresh.patch:
    - Perform an apt update if there is no appstream available (LP: #1554023)
  * debian/patches/sideload-workaround.patch:
    - Applied upstream

 -- Robert Ancell <email address hidden> Fri, 18 Mar 2016 10:43:09 +1300

Changed in gnome-software (Ubuntu):
status: In Progress → Fix Released
Revision history for this message
Lonnie Lee Best (launchpad-startport) wrote :

I wonder if I'm suffering from this issue. Please take a look at the bug I submitted:
https://bugs.launchpad.net/bugs/1583845

To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

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