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 try to use wget to download this but failed.

  sam@sam:/media/Data/code/ros/recognition/rein$ wget
  --2012-10-04 16:29:30--
  Resolving (
  Connecting to (||:443... connected.
  HTTP request sent, awaiting response... Read error (Connection reset by peer) in headers.

  --2012-10-04 16:29:32--  (try: 2)

But I can use firefox to download.

How to download this kind of file in wget?

Thank you~

share|improve this question
Works here, at least in my case (Serbia) – medigeek Oct 4 '12 at 8:52
Check this article. Turning off TCP window scaling might help you. echo 0 > /proc/sys/net/ipv4/tcp_window_scaling – devav2 Oct 4 '12 at 12:17
Permission denied when I run that command. What to do next? Thank you~ – sam Oct 8 '12 at 2:17
in fact i use axel instead, but also usually cannot download files that small (1.2kb). – cipricus Jun 25 '13 at 22:34

Some websites or servers block wget (and similar tools) in order to only allow downloads from a browser. You can trick the website into thinking that you are an actual browser. There are many examples available on google. Here is a particularly complete one taken from askapache. To find alternatives just google wget pretend browser.

  --user-agent="Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv: Gecko/20070725 Firefox/" 
  --header="Accept: text/xml,application/xml,application/xhtml+xml,text/html;q=0.9,text/plain;q=0.8,image/png,*/*;q=0.5" 
  --header="Accept-Language: en-us,en;q=0.5" 
  --header="Accept-Encoding: gzip,deflate"
  --header="Accept-Charset: ISO-8859-1,utf-8;q=0.7,*;q=0.7" 
  --header="Keep-Alive: 300" 
  -dnv [THE URL; in your case:]/ticket/5069/rein_cmakelists2.patch

This is one command, though I put it on several lines to increase readability. You can make it an alias to make it easier to use.

share|improve this answer

This may due to the site use ticket along with cookies for downloading (some other methods too). So when using wget it's necessary to load cookies file as well as other option like user agent, etc.

For example: "wget" --trust-server-names -c -O jre-7u21-linux-x64.rpm --directory-prefix=/home/totti/Downloads --referer= \?locale=en --load-cookies=/tmp/flashgot.7gavixy1.default/cookies --header=Cookie:s_vi=[CS]v1\|28BA8A90050109CA-6000011540153427[CE]\;\ --user-agent=Mozilla/5.0\ (X11\;\ Ubuntu\;\ Linux\ i686\;\ rv:16.0)\ Gecko/20100101\ Firefox/16.0 \?AuthParam=1366627766_80a413ae29c4b4d2e12ac7e334d61847\&GroupName=JSC\&FilePath=/ESD6/JSCDL/jdk/7u21-b11/jre-7u21-linux-x64.rpm\&File=jre-7u21-linux-x64.rpm\&

This can be easily done using the firefox extension Flashgot. (pls some one a add link to it)

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.