0
$file ccache-2.4.tar.gz 
ccache-2.4.tar.gz: HTML document, ASCII text

The file, ccache-2.4.tar.gz is in the ASCII test format

 ccache-2.4.tar.gz: not in gzip format

tar: This does not look like a tar archive
tar: Exiting with failure status due to previous errors

kindly provide your suggestion

2
  • 3
    You downloaded the file incorrectly. Maybe you got an authentication page, maybe you got a download page. Shows us how you downloaded the file. If you used wget or curl, try using a browser.
    – muru
    Mar 25, 2022 at 7:50
  • i have searched for the string ccache , shows below given link ".samba.org/ftp/ccache/ccache-2.4.tar.gz
    – vignesh
    Mar 25, 2022 at 7:55

2 Answers 2

3

The file available in https://www.samba.org/ftp/ccache/ccache-2.4.tar.gz is really a tar archive. Therefore, the real question is not "How do I convert it from ASCII to tar format", but "Why does the file is an ASCII file instead of a tar?"

Probably, you downloaded the file incorrectly (and ASCII file contains the error strings returned by the server), or who gave you the file did. Use a browser to download it or, if you want to do it by terminal, run:

curl -sfL "https://www.samba.org/ftp/ccache/ccache-2.4.tar.gz" -o ~/Downloads/ccache-2.4.tar.gz

or

wget -nv "https://www.samba.org/ftp/ccache/ccache-2.4.tar.gz" -O ~/Downloads/ccache-2.4.tar.gz

The file ccache-2.4.tar.gz will be downloded in your ~/Downloads directory.

0

Since it is not a tar file but ASCII you can rename the file: remove 'tar.gz" and replace it by ".txt" with...

cp ccache-2.4.tar.gz ccache-2.4.txt

and you will be able to view the contents with "more", "less" or a text editor.

3
  • how do i convert the ASCII format to tar archive
    – vignesh
    Mar 25, 2022 at 8:31
  • @vignesh You don't. See this answer.
    – vidarlo
    Mar 25, 2022 at 10:55
  • Renaming the file shouldn't be necessary to do that, if a file is a text-file, one should be able to open the file with a text-editor, more or less anyway, regardless of it's name.
    – mook765
    Mar 25, 2022 at 11:32

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .