Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Untar a file on Solaris reports - tar: directory checksum error

Tags:

linux

tar

Hi I am trying to untar a compressed file on a Solaris server. I run the command

tar xvf 4.56_release.tar.gz

But this reports the following error

tar: directory checksum error

Initially I thought it was a bad download so I re-downloaded the file (actually a different version) and it reports the same error. Un-compressing and un-tar'ing it on Linux on a Linux server works fine.

Any ideas what I am doing wrong.

like image 201
Shawn Vader Avatar asked Aug 19 '11 10:08

Shawn Vader


People also ask

What is tar untar?

Definition of Linux Untar. Untar is defined as a command which enables users to extract files that are compressed with tar, tar. gz, tar. bz2 formats of compression. This command is used for 2 specific utilities in file operations.

What is tar XVF command in Linux?

$ tar xvzf file.tar.gz. 5. Creating compressed tar archive file in Linux using option -j : This command compresses and creates archive file less than the size of the gzip. Both compress and decompress takes more time then gzip.


2 Answers

The .tar.gz is the hint for what you are doing wrong - you are not uncompressing it first. If your version of tar supports it, you can use the -z flag to specify it is compressed with gzip:

tar -xzvf 4.56_release.tar.gz

Otherwise, you'll have to gunzip it manually:

gunzip -c 4.56_release.tar.gz | tar xvf -

(The reason it works on Linux is probably that is has a newer/different version which automagically detects the compression)

like image 100
carlpett Avatar answered Oct 12 '22 05:10

carlpett


If you have a '.tar.bz2' type of archive file and neither of the above options worked ('-z' is not supported for your version of 'tar'), you can use:

bzip2 -d your_file.tar.bz2

to decompress, then use tar:

tar -xvf your_file.tar

Taken from here: https://www.linuxquestions.org/questions/solaris-opensolaris-20/how-to-unpack-a-tar-bz2-file-654772/

like image 2
Ilya K. Avatar answered Oct 12 '22 03:10

Ilya K.