22

When I run this command:

sudo add-apt-repository ppa:webupd8team/sublime-text-3

I get the following error:

Cannot add PPA: 'ppa:~webupd8team/ubuntu/sublime-text-3'.
ERROR: '~webupd8team' user or team does not exist

My proxy settings are working properly

what's the solution?

7
  • 2
    APT seems to not work behind certain proxy types/configurations. – user692175 Nov 1 '17 at 23:25
  • Did you configure apt - askubuntu.com/questions/257290/configure-proxy-for-apt ? If so try to manually add the repo deb http://ppa.launchpad.net/webupd8team/sublime-text-3/ubuntu YOUR_UBUNTU_VERSION_HERE main – Panther Nov 1 '17 at 23:26
  • 1
    I think it's more simply that wepupd8team hasn't updated the ppa for bionic, the last update is almost 40 weeks old. Edit: launchpad.net/~webupd8team/+archive/ubuntu/sublime-text-3 Open that link and click on "tecnical details about this ppa", you'll see it doesn't have a bionic(18.04) version – dsSTORM May 15 '18 at 17:33
  • @David Foerster I don't actually know if OP is using 18.04, though, if he confirms it I'll surely post my comment as an answer. – dsSTORM May 15 '18 at 17:44
  • 1
    @dsSTORM: I just saw that this question is from November and that the PPA in question had packages for all supported Ubuntu releases at the time. Nevermind then. – David Foerster May 15 '18 at 19:01
22

I found a working solution at add-apt-repository derrière un proxy d'entreprise (in French).

To summarize it, you have to export the env variables HTTP(S)_PROXY, lowercase and uppercase in your term.

Then execute:

sudo -E add-apt-repository ppa:...

The -E option will preserve the env vars defined above, and will enable the proxy use.

2
  • 1
    Unfortunately this didn't work for me in ubuntu 18.04 when trying to install Oracle 8 JDK. I fixed it by putting deb http://ppa.launchpad.net/webupd8team/java/ubuntu bionic main in the Software Updater's settings (Settings > Other Software > Add...) – snark Sep 7 '18 at 10:50
  • 1
    This worked under Windows Subsystem for Linux ( Ubuntu 19.x ) for me. – user17723 Sep 13 '19 at 17:45
3

Running add-apt-repository without internet connection really does produce the same error message as in the question. One might consider the error message being incorrect or confusing like this as a bug though.

Adding the corresponding repositories is not enough unless you have an internet connection.

I fixed this by making an internet connection because the repositories had already been added.

Check this with: $ ping www.google.com

2
  • 1
    Running add-apt-repository without internet connection really does produce the same error message as in the question, so this answer is 100% valid. One might consider the error message being incorrect or confusing like this as a bug though. – Byte Commander Dec 8 '19 at 15:18
  • @ByteCommander Thank you very much for understanding and moderating this answer. I added your comment to the body of the response. Regards – Braian Coronel Dec 9 '19 at 1:09
1

In my case it was my company's man-in-the-middle fake SSL certificate that caused this misleading error. If you are on corporate internet, you may need to install your company's SSL cert at /usr/local/share/ca-certificates/yourcompany.crt and run sudo apt-get update && sudo apt-get install ca-certificates -y && update-ca-certificates

1

Also, consider your VPN activity when using WSL as in general VPN's and WSL (Ubuntu) don't mix well. So if you are receiving these errors with a VPN connected, try disabling your VPN and running the command again. This is an odd fix that should be attempted if the above mentioned solutions aren't working for you.

More info here: https://docs.microsoft.com/en-us/windows/wsl/troubleshooting under the Bash loses network connectivity once connected to a VPN

0

It seems add-apt-repository doesn't use apt proxy settings (maybe it's using wget under the hood). A workaround is to tun the command from a machine which is not behind a proxy and to copy the files

/etc/apt/trusted.gpg.d/ondrej_ubuntu_php.gpg
/etc/apt/sources.list.d/ondrej-ubuntu-php-xenial.list

to the other machine.

1
  • 2
    …or simply use the manual method described on Launchpad for each PPA. – David Foerster May 15 '18 at 17:39

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.