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.
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/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/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:
1
-DISTRIB_ID=elementary
2
-DISTRIB_RELEASE=6
3
-DISTRIB_CODENAME=odin
4
-DISTRIB_DESCRIPTION="elementary OS 6 Early Access"
5
+DISTRIB_ID=Ubuntu
6
+DISTRIB_RELEASE=20.04
7
+DISTRIB_CODENAME=focal
8
+DISTRIB_DESCRIPTION="Ubuntu 20.04.1 LTS"
Copied!
Edit sudo vi /etc/os-release:
1
-NAME="elementary OS"
2
-VERSION="6 Early Access"
3
-ID=elementary
4
-ID_LIKE=ubuntu
5
-PRETTY_NAME="elementary OS 6 Early Access"
6
-LOGO=distributor-logo
7
-VERSION_ID="6"
8
-HOME_URL="https://elementary.io/"
9
-DOCUMENTATION_URL="https://elementary.io/docs/learning-the-basics"
10
-SUPPORT_URL="https://elementary.io/support"
11
-BUG_REPORT_URL="https://github.com/elementary/os/issues/new"
12
-PRIVACY_POLICY_URL="https://elementary.io/privacy-policy"
13
-VERSION_CODENAME=odin
14
-UBUNTU_CODENAME=focal
15
+NAME="Ubuntu"
16
+VERSION="20.04.1 LTS (Focal Fossa)"
17
+ID=ubuntu
18
+ID_LIKE=debian
19
+PRETTY_NAME="Ubuntu 20.04.1 LTS"
20
+VERSION_ID="20.04"
21
+HOME_URL="https://www.ubuntu.com/"
22
+SUPPORT_URL="https://help.ubuntu.com/"
23
+BUG_REPORT_URL="https://bugs.launchpad.net/ubuntu/"
24
+PRIVACY_POLICY_URL="https://www.ubuntu.com/legal/terms-and-policies/privacy-policy"
25
+VERSION_CODENAME=focal
26
+UBUNTU_CODENAME=focal
Copied!
After you changed both files, try to execute add-apt-repository again.
Last modified 1mo ago
Copy link