Ask Ubuntu is a question and answer site for Ubuntu users and developers. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I´m using proxy and don´t have problems with anything except cURL.

Anytime i try to do:

curl -L

i receive:

curl: (5) Couldn't resolve proxy 'http'


curl --proxy -L

will work good.

Is there any solution for not writing --proxy everytime?

share|improve this question
up vote 4 down vote accepted

From man curl:

-x, --proxy <[protocol://][user@password]proxyhost[:port]>

 Use the specified HTTP proxy. 
 If the port number is not specified, it is assumed at port 1080.

For general use, declare environment variables for http/https

export http_proxy=http://your.proxy.server:port/
export https_proxy=$http_proxy
  1. edit /etc/bash.bashrc add to the end of file :
    export http_proxy=
    export https_proxy=$http_proxy
    export ftp_proxy=
  • OR proxy no username and password case - :
    export http_proxy=
    export https_proxy=$http_proxy
    export ftp_proxy=
share|improve this answer
seems like i lacked export https_proxy=$http_proxy line in my ~/.bashrc. Thank you. – ted Feb 8 '13 at 8:35

What happens is that you have a http_proxy environment variable set. By default curl tries to use that first. Your http_proxy is also apparently invalid. To see what you have there, type:

echo $http_proxy

You'd need to check where you're setting http_proxy and fixing that so that it points to the correct one.

The other answer is much more complete than mine :)

share|improve this answer

Your Answer


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

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