I want to add the openjdk repo to my /etc/apt/sources.list file by editing the file. However, I'm not sure what the new line should look like. Currently the file just contains

deb https://repo.puri.sm/pureos green main

which is not the same as how I'm used to referring to repos (ppa:openjdk/ppa). I could guess that the repo I should insert into the document is

deb https://repo.puri.sm/pureos green main
deb https://openjdk.java.net/projects/jdk/11/ 

but it'd just be a guess. I can't find any straight-forward statement of what the address of the openjdk repo is.

So in general, when trying to find a repo, how do you know what the address of the repo is? Do you look for some particular file or directory linked within the page, and then you just select the web address of that page?

Why I'm adding the repo this way:

I have a new machine running PureOS which under the hood seems to run similar to how Ubuntu does. I tried sudo add-apt-repository ppa:openjdk/ppa but the terminal returns

Traceback (most recent call last):
  File "/usr/bin/add-apt-repository", line 95, in <module>
    sp = SoftwareProperties(options=options)
  File "/usr/lib/python3/dist-packages/softwareproperties/SoftwareProperties.py", line 109, in __init__
  File "/usr/lib/python3/dist-packages/softwareproperties/SoftwareProperties.py", line 599, in reload_sourceslist
  File "/usr/lib/python3/dist-packages/aptsources/distro.py", line 93, in get_sources
    (self.id, self.codename))
aptsources.distro.NoDistroTemplateException: Error: could not find a distribution template for PureOS/green

I assume this just means that the OS doesn't support this command. Also the package manager seems to have switched over in a recent version change, so that I can't use it to do anything other than get packages in the native repo group.

  • Does PureOS have a version of OpenJDK in its repos? what is the result of apt-cache search openjdk? Your assumptions of the results of the error are correct. That means that there does not exist a template for your OS. – kemotep Mar 19 at 18:57

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.