Software & Updates fails to start ("aptsources.distro.NoDistroTemplateException: Error: could not find a distribution template for PureOS/green")
Closed, ResolvedPublic

Description

mladen@Librem13:~$ software-properties-gtk 
ERROR:root:Cannot import UbuntuDrivers: No module named 'UbuntuDrivers'
Traceback (most recent call last):
  File "/usr/bin/software-properties-gtk", line 101, in <module>
    app = SoftwarePropertiesGtk(datadir=options.data_dir, options=options, file=file)
  File "/usr/lib/python3/dist-packages/softwareproperties/gtk/SoftwarePropertiesGtk.py", line 109, in __init__
    SoftwareProperties.__init__(self, options=options, datadir=datadir)
  File "/usr/lib/python3/dist-packages/softwareproperties/SoftwareProperties.py", line 109, in __init__
    self.reload_sourceslist()
  File "/usr/lib/python3/dist-packages/softwareproperties/SoftwareProperties.py", line 599, in reload_sourceslist
    self.distro.get_sources(self.sourceslist)    
  File "/usr/lib/python3/dist-packages/aptsources/distro.py", line 93, in get_sources
    (self.id, self.codename))
aptsources.distro.NoDistroTemplateException: Error: could not find a distribution template for PureOS/green
mladen created this task.Feb 24 2019, 6:04 PM
chris.lamb changed the title from "Software & Updates cannot start" to "Software & Updates fails to start ("aptsources.distro.NoDistroTemplateException: Error: could not find a distribution template for PureOS/green")".Feb 24 2019, 6:09 PM

Software and Updates starts, it just fails to find a distribution template for PureOS

Wayne added a subscriber: Wayne.Mar 6 2019, 8:05 PM

I believe this is the same problem as T660. In my case, this application does not launch. Fortunately, I do not use it very much.

mak added a comment.Mar 6 2019, 8:29 PM

Grrr, this means a distro patch to python-qpt got reverted in PureOS somehow.
I will have a look, thanks for the direct bug assignment!

I was commenting on a PureOS forum topic, and I discovered the same error when using Software->left application icon->Software Repositories. My system log file displayed the above stack.

I assume Software uses the same utility to find the repositories. This is probably not a revelation, but it is another data point.

It looks like the patch was put in upstream python-apt https://metadata.ftp-master.debian.org/changelogs//main/p/python-apt/python-apt_1.8.4_changelog
It doesn't look like we bring it into PureOS however. It appears at the moment that python-apt is being rebuilt;

$ apt-cache policy python-apt
python-apt:
  Installed: 1.8.1pureos1
  Candidate: 1.8.1pureos1
  Version table:
 *** 1.8.1pureos1 500
        500 https://repo.puri.sm/pureos green/main amd64 Packages
        100 /var/lib/dpkg/status

A newer version of the GNOME Software application (gnome-software and gnome-software-common) still produces this bug. I think Matthias is pointing to the fact that the issue is in python-apt and that is independent from GNOME Software.

mak added a comment.May 2 2019, 8:50 PM

Hmm... This is the last changelog entry for python-apt:

python-apt (1.8.1pureos1) green; urgency=medium

  [ Jonas Smedegaard ]
  * Fork for PureOS:
    + Set PureOS Maintainers as maintainer,
      leaving original as XSBC-Original-Maintainer.
    + Drop uploaders (package is team-maintained for PureOS).
    + Replace Vcs-* fields.
    + Update git-buildpackage config:
      - Set branches.
      - Use purism/* namespace for release tags.
      - Avoid use pristine-tar.
      - Drop prebuild script.
      - Drop export-dir.
    + Add README.source.

  [ Matthias Klumpp ]
  * Add PureOS distribution information.

 -- Jonas Smedegaard <dr[at]jones.dk>  Mon, 28 Jan 2019 15:06:24 +0100

Looks like my patch from the previous version before Jonas rebased it was not applied completely, as the files in data/templates for PureOS are missing, causing this bug. I'll fix this by adding them back.

mak closed this task as "Resolved".May 2 2019, 9:07 PM

This is fixed in python-apt >= 1.8.4pureos1 - please verify that this works for you. The new version should reach the green channel in a few days.

wellton added a subscriber: wellton.May 3 2019, 7:54 PM
This comment was removed by wellton.
Wayne added a comment.May 4 2019, 4:10 PM

I just updated my system (PureOS - all updates on Librem 13v3), and "Software and Updates" does not work. From Tilex:

python-apt/green,now 1.8.4pureos1 amd64 [installed,automatic]

In log:

software-properties-gnome.desktop[1408]: ERROR:root:Cannot import UbuntuDrivers: No module named 'UbuntuDrivers'
software-properties-gnome.desktop[1408]: Traceback (most recent call last):
software-properties-gnome.desktop[1408]:   File "/usr/bin/software-properties-gtk", line 101, in <module>
software-properties-gnome.desktop[1408]:     app = SoftwarePropertiesGtk(datadir=options.data_dir, options=options, file=file)
software-properties-gnome.desktop[1408]:   File "/usr/lib/python3/dist-packages/softwareproperties/gtk/SoftwarePropertiesGtk.py", line 109, in __init__
software-properties-gnome.desktop[1408]:     SoftwareProperties.__init__(self, options=options, datadir=datadir)
software-properties-gnome.desktop[1408]:   File "/usr/lib/python3/dist-packages/softwareproperties/SoftwareProperties.py", line 109, in __init__
software-properties-gnome.desktop[1408]:     self.reload_sourceslist()
software-properties-gnome.desktop[1408]:   File "/usr/lib/python3/dist-packages/softwareproperties/SoftwareProperties.py", line 599, in reload_sourceslist
software-properties-gnome.desktop[1408]:     self.distro.get_sources(self.sourceslist)
software-properties-gnome.desktop[1408]:   File "/usr/lib/python3/dist-packages/aptsources/distro.py", line 93, in get_sources
software-properties-gnome.desktop[1408]:     (self.id, self.codename))
software-properties-gnome.desktop[1408]: aptsources.distro.NoDistroTemplateException: Error: could not find a distribution template for Pureos/n/a

Is that really an accurate template in the last line?

Wayne reopened this task as "Open".May 4 2019, 4:10 PM
mak closed this task as "Resolved".EditedMay 4 2019, 5:35 PM

This is now a new issue, caused by a change in lsb-release which was switched to exclusively read /etc/os-release and started to capitalize the distribution-ID, which works for Debian, but not for PureOS.
I submitted a patch upstream: https://salsa.debian.org/debian/lsb/merge_requests/1

This should finally resolve the issue. Please ensure you have base-files >= 10.1pureos4 and lsb-release >= 10.2019031300pureos1 installed before testing!
Cheers,
Matthias

Wayne added a comment.May 4 2019, 7:38 PM

Thanks. Those two packages just became available and it works now.

Can confirm it works on my end, thank you everyone.

Add Comment