Running on a freshly booted instance of ubuntu 16.04 LTS cloud image, I'm trying to add juju ppa with the following command:

ubuntu@gateway:~$ sudo add-apt-repository --update ppa:juju/stable
Cannot add PPA: 'ppa:~juju/ubuntu/stable'.
ERROR: '~juju' user or team does not exist.

Few contextual information:

  • I'm connected through ssh on this gateway machine
  • this instance is running in our openstack private cloud
  • it has access to the web (ie "apt update" runs fine)
  • there is a proxy for http/https which is set in /etc/environment
  • we installed our on SSL certificate issuer for https proxy

I'm pretty sure it's related to the last point and/or the proxy that is not correctly used by add-apt-repository... Any help would be welcome.


The cert should be added by add-apt automatically. if you are sure that there is no typo in the PPA name, maybe try without the --update. I am using the syntax without --update and it worked fine. You could also check the normal url in a browser:


It should list the structure with the files. If not check that address. Using /etc/apt/sources.list you could also add the path manually, but then need to download the certificate and install it in /etc/apt/trusted.d folder.


  • Technically not the answer but I think your pointed in the right direction. The --update did not change anything and the url is accessible from my machine. But the certificate is invalid since my proxy rewrite them on the fly (so it can audit all traffic). So I need to declare our local certificate issuer in apt trusted and it should be ok. I'll test that (didn't know it was independent from cert in /usr/local/share/ca-certificates/ ) and I'll update soon. – gdupont Jul 28 '17 at 10:01
  • @gdupont If that indeed was the issue, I guess it would be interesting for others to learn about that implication of using a certain proxy. Would be nice if you would create an answer yourself describing the causing issue and the solution and accept it yourself to mark the questions as close. Glad I could hint. – CatMan Jul 28 '17 at 10:17
  • 1
    I suggest installing juju as snap. Installing it from PPA is to have specific version to run tests is fine but preferred way is to have it as snap. – bogdan Aug 7 '18 at 9:09
  • 1
    Not so soon feedback: I managed to fix by adding the local certificate in apt trusted. @bogdan: not sure the snap package was ready at time I asked the question (or I was not really familiar with snap yet...) – gdupont Aug 9 '18 at 9:08

This is likely because you have an invalid date set. This will make most SSL certificates be invalid, and many apt-related programs will produce unexpected outputs.

Try opening Time & Date Settings from the date applet and use the Internet update, or install an ntp service to keep it updated automatically.

  • Thanks for the feedback, unfortunately, not the issue (NTP hierarchy was fine and top level was a GPS box...). But I checked that since it might have been the issue. – gdupont Aug 9 '18 at 9:08

Your Answer

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

Not the answer you're looking for? Browse other questions tagged or ask your own question.