incorrectly reports package as unsupported if apt cache is empty

Bug #1775219 reported by Robert C Jennings on 2018-06-05
This bug affects 1 person
Affects Status Importance Assigned to Milestone
apport (Ubuntu)

Bug Description

Cloud images ship with empty /var/lib/apt/lists/ to save on size. Running 'ubuntu-bug <supported_package>' will erroneously report that the package is unsupported:

  $ ubuntu-bug coreutils

  *** Collecting problem information

  The collected information can be sent to the developers to improve the
  application. This might take a few minutes.

  *** Problem in coreutils

  The problem cannot be reported:

  This is not an official Ubuntu package. Please remove any third party package and try again.

A simpler recreate is:

$ python3 -c 'import apport;print(apport.packaging.is_distro_package("coreutils"))'
$ sudo apt update -qq
All packages are up to date.
$ python3 -c 'import apport;print(apport.packaging.is_distro_package("coreutils"))'

Desired result:

The message should instruct the user to run 'apt update' as root if they think this is in error. That would improve usability and avoid false reports about apport incorrectly flagging a package as unsupported.

Additionally, if the user is root (and optionally if the set of package candidates only contains a 'now' component) self._cache.update(); could be called to download lists.

Alternatively it could just check to see if lists have been downloaded.

Robert C Jennings (rcj) on 2018-06-05
description: updated
tags: added: bionic cosmic
Brian Murray (brian-murray) wrote :

Here is a previous bug report about this issue.

Brian Murray (brian-murray) wrote :

And here is another one with a specific way of hacking around the problem:

Robert C Jennings (rcj) wrote :

Brian, the hack doesn't seem workable. Touching channel.ini would then flag all images as being supported, which isn't true. It's unclear what knock-on effects we would have touching this file (i.e. what other tools see it and take different code-paths). The existence of the file indicates that the image is a read-only system image, this is untrue for minimal.

I would still like to see this resolved, even if that is just an improvement in the error message suggesting 'apt-get update' and retrying.

Hack details:
*, is_distro_package(): If there is no origin and
  /etc/system-image/channel.ini exists, assume the package is from a
  read-only system image and accept it as distro package. With this we don't
  need /var/lib/apt/lists/ indexes any more just to confirm the origin.
  (LP: #1489410)

Robert C Jennings (rcj) on 2018-06-12
tags: added: id-5b1fe4c2babaab7ab6fd5d37
To post a comment you must log in.
This report contains Public information  Edit
Everyone can see this information.

Other bug subscribers