1

I'm using a Debian-based OS distribution (Devuan, to be specific). I'm trying to use the apt-add-repository Python-based program, which is part of the software-properties-common package.

Unfortunately, running it - fails, and I get:

Traceback (most recent call last):
  File "/usr/bin/apt-add-repository", line 361, in <module>
    addaptrepo = AddAptRepository()
  File "/usr/bin/apt-add-repository", line 39, in __init__
    self.distro.get_sources(self.sourceslist)
    ~~~~~~~~~~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^
  File "/usr/lib/python3/dist-packages/aptsources/distro.py", line 92, in get_sources
    raise NoDistroTemplateException(
    ...<2 lines>...
    )
aptsources.distro.NoDistroTemplateException: Error: could not find a distribution template for devuan/excalibur ceres

I've gone over the script itself - the "templates" are not there; I've also looked through a couple of potential files it imports, also no luck, or perhaps I've missed something.

My questions:

  • Where are those "distribution templates" actually located?
  • How can I add a template to suit my distribution?
5
  • Did you download this from Github? If so do you have a link? Commented Feb 6 at 21:45
  • @eyoung100: It's part of a Debian package, see link. Commented Feb 6 at 21:59
  • I peeked at the File listing for python-apt-common and found the location of the templates folder. Does ls /usr/share/python-apt/templates have output? Commented Feb 6 at 22:20
  • @eyoung100: Yes it does... and there's even a pair of files for Devuan there. I wonder why they don't match. Commented Feb 6 at 22:32
  • Try sudo nano -w /usr/share/python-apt/templates/nameoffile. You may need to edit them in order to match for the missing version. Commented Feb 6 at 22:43

1 Answer 1

2

This is a bug in python-apt-common-devuan — it doesn’t describe excalibur. Templates are located in /usr/share/python-apt/templates, and derivatives are supposed to provide their own (which Devuan does).

You should be able to fix this by editing /usr/share/python-apt/templates/Devuan.info to add an excalibur entry:

Suite: excalibur
RepositoryType: deb
BaseURI: http://deb.devuan.org/merged/
MatchURI: [a-z]{2}\.deb\.devuan\.org
MirrorsFile: Devuan.mirrors
_Description: Devuan 6 'Excalibur'
Component: main
_CompDescription: Officially supported
Component: contrib
_CompDescription: DFSG-compatible Software with Non-Free Dependencies
Component: non-free
_CompDescription: Non-DFSG-compatible Software
5
  • Actually, I think it might be a pair of bugs, since the "codename" the Python script derives for my distribution is "excalibur ceres" rather than just "excalibur". But together with this, I could perhaps arrange for some workaround. Commented Feb 7 at 8:13
  • Oh, and another thing is that the script determines the distribution template's distro name is "Devuan", but the system's distro name is determined to be "devuan", lowercase. Commented Feb 7 at 8:35
  • If you’re referring to the file name, that doesn’t matter, the matcher loads all .info files. Commented Feb 7 at 10:48
  • Thanks for fleshing out my comment :) Commented Feb 7 at 23:38
  • @StephenKitt: No, I'm referring to the strings being compared within the Python script. But your answer already helps. Commented Feb 8 at 7:51

You must log in to answer this question.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.