Take the 2-minute tour ×
Ask Ubuntu is a question and answer site for Ubuntu users and developers. It's 100% free, no registration required.

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.

share|improve this question
1  
Its your internet connection. Your system can't resolve launchpad.net while you're on that proxy. –  Thomas W. Jun 27 '12 at 14:57

9 Answers 9

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=
share|improve this answer
1  
This helped, thanks! In my case: export https_proxy=$(echo $http_proxy | sed 's/http:/https:/') –  akavel Nov 30 '12 at 16:13

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

share|improve this answer
    
well i have no other connections other than the proxy.. i am in a college. our connection is proxy based. the most troubling fact is that i am able to install most applications via sudo apt-get install like normal. but PPA installations are not working. you really think the proxy is a concern ? –  user60660 May 5 '12 at 10:53
    
as the error reflects, it reports threw a python url error. All seems to be correctly configured except that python now has not got correctly over proxy. so why don't just write a simple python program to test if it is working with the current url settings? go here or else you can set proxy for the terminal like explained here –  ashutosh May 5 '12 at 11:18
    
i have my proxy settings put carefully in network proxy. So as such my "env | grep proxy" gives the correct proxy settings. the terminal is able to use the proxy.other wise apt-get would show connection errors.i added the ppa in the source list of ubuntu software center in the form of: deb ppa.launchpad.net/<user>/<repo>/ubuntu precise main for a PPA based on : ppa:<user>/<repo> This worked after doing apt-get update.the PPA was added. i was able to install the software that was found in the PPA. something is wrong with python-software-properties. proxy is fine. –  user60660 May 5 '12 at 13:04

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?

share|improve this answer

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?

share|improve this answer
    
That -E saved me a lot of time, everything else was setup properly. thanks –  Muriuki David Jan 23 at 10:13

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.

share|improve this answer

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.

share|improve this answer

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.

share|improve this answer

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.

share|improve this answer

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.

share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.