Problem with wget

I cannot download anything using wget in centos 6.5 and 7. But I can update yum etc.

# wget https://wordpress.org/latest.tar.gz
--2014-10-23 13:50:23--  https://wordpress.org/latest.tar.gz
Resolving wordpress.org... 66.155.40.249, 66.155.40.250
Connecting to wordpress.org|66.155.40.249|:443... failed: Connection timed out.
Connecting to wordpress.org|66.155.40.250|:443... failed: Connection timed out.
Retrying.

Also I cannot ping to google. But I can ping to our DNS, Proxy, Router etc.

# ping 8.8.8.8
PING 8.8.8.8 (8.8.8.8) 56(84) bytes of data.

I am behind a proxy server. And I can wget with a real ip. What could be the wrong.

Seems to be working (in general):

:) ~ $ wget https://wordpress.org/latest.tar.gz
--2014-10-23 10:41:22--  https://wordpress.org/latest.tar.gz
Aufl�sen des Hostnamen �wordpress.org (wordpress.org)�... 66.155.40.249, 66.155.40.250
Verbindungsaufbau zu wordpress.org (wordpress.org)|66.155.40.249|:443... verbunden.
HTTP-Anforderung gesendet, warte auf Antwort... 200 OK
L�nge: 6051082 (5.8M) [application/octet-stream]
In ��latest.tar.gz�� speichern.

100%[=====================================================================================================================>] 6'051'082   1.21MB/s   in 5.5s   

2014-10-23 10:41:29 (1.05 MB/s) - ��latest.tar.gz�� gespeichert [6051082/6051082]

Did you try with curl?
Allthough i would expect the same behaviour.

curl -o latest.tar.gz https://wordpress.org/latest.tar.gz

Either way, you can pass the (your) proxy server (information).

+ ~ $ wget --help |grep proxy
       --no-proxy                explicitly turn off proxy.
       --proxy-user=USER       set USER as proxy username.
       --proxy-password=PASS   set PASS as proxy password.

Hope this helps

1 Like

Thank you for kind help. curl didn't work either as you said.

Therefore I added the proxy settings to the wget configuration file. Then it worked but stopped saying certificate error. Therefore I did --no-check-certificate. Then it worked.

Any idea what was the wrong? Also ping to google did not worked too.

If wget doesn't work without a proxy, you may be behind a firewall of some sort. They could block destinations and addresses and protocols however they please.