Search This Blog

Monday, November 22, 2010

How to configure proxy for wget command?

Its very common to get following error while using wget to download .
Lets take an example :

I m trying to download vsftpd-2.3.2.tar.gz using wget .
I have got following error .

# wget
=> `vsftpd-2.3.2.tar.gz'
Resolving failed: Temporary failure in name resolution.

From Error its clear that wget is unable to download the file .
Reason 1: It is unable to resolve the IP address .
Reason 2: Its is unable to reach the Destination .

Both these factors indicates absence of proxy .While its a very easy to define proxy server in Browser when we dont get any internet connection (Most of time its set on automatic detection)But for wget you need to modify following file and point it to the proxy server.

Just add following lines to /etc/wgetrc files.

http_proxy = http://:/
use_proxy = on
wait = 15

just save it and you are done.

Now try to run the command and you should able to download the file as
I have done it here.

# wget
Connecting to :... connected.
Proxy request sent, awaiting response... 200 OK
Length: unspecified
Saving to: `vsftpd-2.3.2.tar.gz'

[ <=> ] 187,229 --.-K/s in 0.03s

18:15:42 (6.95 MB/s) - `vsftpd-2.3.2.tar.gz' saved [187229]

Please Leave us with your comments and Queries/Suggestions.
I will try to reply asap.

No comments:

Post a Comment