Error: could not find distribution template for Elementary/odin

How to fix could not find a distribution template for Elementary/odin when executing add-apt-repository.

elementary OS: 6 Odin Pre-Release Status: Verified

If you like my work, ❤️ Sponsor Me. It would mean the world to me!

You might encounter the following error during execution of add-apt-repository:

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

This error is due to the pre-release nature of elementary 6.0 Odin and should be fixed once the stable version is released. Meanwhile you can apply the existing workaround:

Edit sudo vi /etc/lsb-release:

-DISTRIB_DESCRIPTION="elementary OS 6 Early Access"

Edit sudo vi /etc/os-release:

-NAME="elementary OS"
-VERSION="6 Early Access"
-PRETTY_NAME="elementary OS 6 Early Access"
+VERSION="20.04.1 LTS (Focal Fossa)"
+PRETTY_NAME="Ubuntu 20.04.1 LTS"

After you changed both files, try to execute add-apt-repository again.