-1

I am trying to install the latest apache ant to centos. I did as follows:

  1. wget http://ant.apache.org/bindownload.cgi/apache-ant-1.8.2-bin.tar.gz

  2. gzip -d apache-ant-1.8.2-bin.tar.gz

and I get the error as follows:

gunzip: apache-ant-1.8.2-bin.tar.gz: not in gzip format

However If do as follows:

  1. Download the tar.gz file from the GUI to a desktop folder
  2. Open up a terminal, navigate to the directory where the .gz has been downloaded.
  3. gzip -d apache-ant-1.8.2-bin.tar.gz
  4. tar -xvf apache-ant-1.8.2-bin.tar

Everything gets decompressed and extracted correctly.

But why does the first way does not work?

Thanks in advance

  • Dario
Viriato
  • 101
  • 1
  • 2

1 Answers1

2
$ wget http://ant.apache.org/bindownload.cgi/apache-ant-1.8.2-bin.tar.gz
$ file apache-ant-1.8.2-bin.tar.gz 
apache-ant-1.8.2-bin.tar.gz: ASCII HTML document text, with very long lines

You just downloaded a link to the mirrors to download the files from

Hit the url on your browser and see. Grab the file from there

http://ant.apache.org/bindownload.cgi/apache-ant-1.8.2-bin.tar.gz
Mike
  • 22,310
  • 7
  • 56
  • 79
  • Hi Mike, Thanks a lot it makes complete sense now. I am trying to stay away from the gui or even a two step process of downloading the file and then ftp it over to the server. So Is there a way to use wget command to bring the actual .gz file down? – Viriato May 22 '11 at 22:28
  • yes.. like i said.. visit the page in your browser and use one of the mirror links http://apache.osuosl.org//ant/binaries/apache-ant-1.8.2-bin.tar.gz – Mike May 22 '11 at 22:31
  • I dont think I udnderstand you, If I click on the mirror links I see how I can down the tar.gz but still if I grab the mirror link and append the file name and put that in the wget command is not working so this is what I did to solve it. I did a page/view source look at the url of tar.gz file that I am looking for and used that in my wget command it worked then – Viriato May 22 '11 at 22:42