1

I'm currently facing this issue with add-apt-repository. Whenever I try to do anything (adding or even removing repos), I get this error:

Traceback (most recent call last):
  File "/usr/bin/add-apt-repository", line 108, in <module>
    sp = SoftwareProperties(options=options)
  File "/usr/lib/python3/dist-packages/softwareproperties/SoftwareProperties.py", line 118, in __init__
    self.reload_sourceslist()
  File "/usr/lib/python3/dist-packages/softwareproperties/SoftwareProperties.py", line 613, in reload_sourceslist
    self.distro.get_sources(self.sourceslist)    
  File "/usr/lib/python3/dist-packages/aptsources/distro.py", line 91, in get_sources
    raise NoDistroTemplateException(
aptsources.distro.NoDistroTemplateException: Error: could not find a distribution template for Elementary/next

Note that I am currently running Ubuntu 20.04, yet the error says something about Elementary OS.

I already looked for possible solutions (like this one with ppa-purge as well as some others), but none of them worked out.

Right now, I cannot add any repos to apt, which is super annoying.

Thanks in advance for your help!

thetek
  • 13

1 Answers1

1

Try this solution : https://github.com/elementary/os/issues/399#issuecomment-698652540

Also, try reinstalling software-properties-common package by the command sudo apt install --reinstall software-properties-common

  • Thank you! Any idea why this happened? Why would it set my OS to Elementary when I'm on Ubuntu? – thetek Sep 27 '20 at 10:18
  • It seems that this problem probably occurred due to wrong distribution info in /etc/*-release files. These files belong to base-files package. I think you somehow managed to tamper these files. It may be caused due to a partially applied update of that package or you may have installed something before that tampered those files. – cheesesticks Sep 27 '20 at 14:02