Ubuntu: Adding PPA's results in “Couldn't resolve host 'launchpad.net'”



Question:

For example, after running this command:

sudo add-apt-repository ppa:tualatrix/ppa  

I get the following output :

Traceback (most recent call last):    File "/usr/bin/add-apt-repository", line 125, in <module>      ppa_info = get_ppa_info_from_lp(user, ppa_name)    File "/usr/lib/python2.7/dist-packages/softwareproperties/ppa.py", line 80, in get_ppa_info_from_lp      curl.perform()  pycurl.error: (6, "Couldn't resolve host 'launchpad.net'")  

Why does this happen? I just installed Ubuntu 12.04 LTS. And it works fine. I have updated and installed the system. I have even installed all required packages. But the thing is as soon as I want to install more packages, like PPA's and that sort of thing, I am not able to do so.

Until now I have not been able to install any PPA.

I am working behind a proxy.


Solution:1

Ah ... I've been caught out with this before! I've been trying to add the webupd8team PPA to my newly installed 12.04

I already had:

export http_proxy=  

but webupd8team (and I think launchpad) need:

export https_proxy=  


Solution:2

As others have said, you need to set HTTP_PROXY and HTTPS_PROXY but you also need to use the option '-E' to tell sudo to use the environment variables you've just set!

sudo -E add-apt-repository ppa:tualatrix/ppa  

ref: How do I get add-apt-repository to work through a proxy?


Solution:3

It seems more like of the proxy problem. The server you are trying to connect to is not getting past through your connection because the proxy connection is refusing it. To get it right, Just close your proxy and they try re-running your program. Maybe that can help


Solution:4

The mentioned error indicates a fault DNS configuration. I find it weird that you can download other packages and visit Ask Ubuntu, but not Launchpad. Try setting an alternative DNS server as described in What is the proper way to change the DNS IP?


Solution:5

I came across this issue as well. Check your /etc/resolv.conf settings using;

sudo vi /etc/resolv.conf  

And add

nameserver IP.ADDRESS.OF.YOUR.DNS.SERVER  nameserver IP.ADDRESS.OF.YOUR.PROXY.SERVER  

This might help.


Solution:6

Here are the commands:

sudo bash  export https_proxy=http://[username:password@]proxyserver:portnumber/  add-apt-repository ppa:whatever

You'll have to edit the italicized lines to provide information specific to your system.


Solution:7

I think this happens because the proxy information is not set to root user. In my system i get those results:

echo $HTTP_PROXY --> http://my.proxy.address  sudo echo $HTTP_PROXY --> (prints nothing)  

So a quick workaround will be:

sudo -i  export HTTP_PROXY="http://username:password@proxy_address:port"  add-apt-repository ppa:tualatrix/ppa  exit  

You could also try setup HTTPS_PROXY, if needed.


Solution:8

I am also facing the same problem. Try this,, It solves the problem. Go to System Settings -> Network -> Network Proxy : Select Method: Manual and assign proxy and port then try.


Solution:9

I had this exact same problem on a 12.04 LTS VM, but I was NOT using a proxy, however I was using a WINS server. The problem turned out to be that I had misconfigured the hosts line of the nsswitch.conf by placing the wins entry before the dns entry.

Problem:

hosts:          wins files dns  

Fix:

hosts:          files dns wins  

Saved and rebooted. Life was good again.


Note:If u also have question or solution just comment us below or mail us on toontricks1994@gmail.com
Previous
Next Post »