aptsources.distro.NoDistroTemplateException: Error: could not find a distribution template

Bug #624927 reported by Monty Taylor
46
This bug affects 10 people
Affects Status Importance Assigned to Milestone
Software Properties
New
Undecided
Unassigned

Bug Description

After upgrading to maverick, I can't use add-apt-repository anymore. The full traceback is:

Traceback (most recent call last):
  File "/usr/bin/add-apt-repository", line 55, in <module>
    sp = SoftwareProperties()
  File "/usr/lib/python2.6/dist-packages/softwareproperties/SoftwareProperties.py", line 90, in __init__
    self.reload_sourceslist()
  File "/usr/lib/python2.6/dist-packages/softwareproperties/SoftwareProperties.py", line 538, in reload_sourceslist
    self.distro.get_sources(self.sourceslist)
  File "/usr/lib/python2.6/dist-packages/aptsources/distro.py", line 90, in get_sources
    raise NoDistroTemplateException("Error: could not find a "
aptsources.distro.NoDistroTemplateException: Error: could not find a distribution template

I got this specifically with:

add-apt-repository ppa:ubuntu-mozilla-daily/ppa

But it has happened so far for every ppa I've tried to add.

Revision history for this message
Tom Gall (tom-gall) wrote :

I've hitting this as well on my amd64 maverick install.

# add-apt-repository ppa:linaro-maintainers/kernel
Traceback (most recent call last):
  File "/usr/bin/add-apt-repository", line 55, in <module>
    sp = SoftwareProperties()
  File "/usr/lib/python2.6/dist-packages/softwareproperties/SoftwareProperties.py", line 90, in __init__
    self.reload_sourceslist()
  File "/usr/lib/python2.6/dist-packages/softwareproperties/SoftwareProperties.py", line 538, in reload_sourceslist
    self.distro.get_sources(self.sourceslist)
  File "/usr/lib/python2.6/dist-packages/aptsources/distro.py", line 90, in get_sources
    raise NoDistroTemplateException("Error: could not find a "
aptsources.distro.NoDistroTemplateException: Error: could not find a distribution template

# ls /etc/apt/sources.list.d
overlay.list
root@w00tstock:~# cat /etc/apt/sources.list.d/overlay.list
# sources.list part for the chessy overlay ppa
deb http://ppa.launchpad.net/linaro-maintainers/overlay/ubuntu maverick main

It does appear that it partially works however trying to add other ppa's fail with the same error.

Revision history for this message
alfer (rmn-shev) wrote :

After upgrading to maverick, I can't use add-apt-repository anymore. The full traceback is:

Traceback (most recent call last):
  File "/usr/bin/add-apt-repository", line 55, in <module>
    sp = SoftwareProperties()
  File "/usr/lib/python2.6/dist-packages/softwareproperties/SoftwareProperties.py", line 90, in __init__
    self.reload_sourceslist()
  File "/usr/lib/python2.6/dist-packages/softwareproperties/SoftwareProperties.py", line 538, in reload_sourceslist
    self.distro.get_sources(self.sourceslist)
  File "/usr/lib/python2.6/dist-packages/aptsources/distro.py", line 90, in get_sources
    raise NoDistroTemplateException("Error: could not find a "
aptsources.distro.NoDistroTemplateException: Error: could not find a distribution template

I got this specifically with:

sudo add-apt-repository ppa:libreoffice/ppa

But it has happened so far for every ppa I've tried to add.

Revision history for this message
François Garillot (garillot) wrote :

This looks tied to python-apt & related to :
http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=513039
(see message 27)

Revision history for this message
Jalakas (jalakas) wrote :

Still happens with precise:

Traceback (most recent call last):
  File "/usr/bin/apt-add-repository", line 160, in <module>
    sp = SoftwareProperties(options=options)
  File "/usr/lib/python2.7/dist-packages/softwareproperties/SoftwareProperties.py", line 96, in __init__
    self.reload_sourceslist()
  File "/usr/lib/python2.7/dist-packages/softwareproperties/SoftwareProperties.py", line 584, in reload_sourceslist
    self.distro.get_sources(self.sourceslist)
  File "/usr/lib/python2.7/dist-packages/aptsources/distro.py", line 87, in get_sources
    raise NoDistroTemplateException("Error: could not find a "
aptsources.distro.NoDistroTemplateException: Error: could not find a distribution template

Revision history for this message
Savvas Radevic (medigeek) wrote :

You have to recreate the file /etc/lsb-release
This file should pre-exist by default for some packages and commands.

For ubuntu precise 12.04:

gksu gedit /etc/lsb-release

and enter this text:

DISTRIB_ID=Ubuntu
DISTRIB_RELEASE=12.04
DISTRIB_CODENAME=precise
DISTRIB_DESCRIPTION="Ubuntu 12.04 LTS"

Save and exit.

Revision history for this message
Salih EMIN (salih-emin) wrote :

Mine already exist but it produces the same error when triing to use add-apt-reposytory

DISTRIB_ID=Ubuntu
DISTRIB_RELEASE=14.04
DISTRIB_CODENAME=trusty
DISTRIB_DESCRIPTION="Ubuntu 14.04.3 LTS"

Revision history for this message
Yves Mulleneers (ymulleneers-w) wrote :

There is simply no option to choose a repository, so other sligly similar distributions get impacted such as : what if /etc/lsbrelease looks like

DISTRIB_ID=LinuxMint
DISTRIB_RELEASE=17
DISTRIB_CODENAME=qiana
DISTRIB_DESCRIPTION="Linux Mint 17 Qiana"

Why not an otion to force which repository to use?

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.