Unable to gunzip .tgz file in AIX6.1

Hi guys,

This is my 1st post here. I tried to Google around but failed to get my solution. So I hope you guys could help me. (I have just a basic unix background for 2years so I'm sorry if im asking stupid questions)

OS - Aix 6.1, 64 bits.
Server - currently I only have telnet access to a Aix machine. ( I don't have SSH access)
The problem - I can't seem to extract or gunzip a .tgz file.

Error 1 ->
# gunzip install.tgz

gunzip: install.tgz: invalid compressed data--crc error

gunzip: install.tgz: invalid compressed data--length error

Error 2 -:>
I also tried to extract an apache file for aix.

# tar -xvf apache-2.2.14_openssl-0.9.8k_modjk-1.2.26_aix53.tar.gz
tar: 0511-169 A directory checksum error on media; 0 not equal to 63252.

Investigations(might help to identify the problem) -

1) Some say its because when I ftp it may transfer as an ACSII file. So i tried typing binary when I ftp to the AIX machine. It showed type set to I. So I just ftp the .tgz file that I want to my AIX machine. So when I tried to gunzip, same thing happened.

my method of transferring file -> I used WinSCP to download the file from a server to my local machine > then from my local machine I ftp to the remote aix machine.

2) gunzip installed in AIX? i tried the gunzip -V
# gunzip -V
gunzip 1.2.4 (18 Aug 93)
Compilation options:
DIRENT UTIME STDC_HEADERS HAVE_UNISTD_H

but on another machine the with the same version, I could successfully gunzip it.

3) is it because the .gzip was compiled in non aix? but the installer.tgz (the file that im trying to unzip) initially supports all OS. I tried in RHEL was fine, in windows2k8 was fine also.

4) I tried checking the file size with the one i transferred to other servers, and it is the same. (FTP takes so long)

Any ideas? please advice? would it be like a binary or library missing? Any suggestions?

cheers
pilotHans

I have looked at the AIX 6.1 tar command and it appears that the .tgz format is not supported. The Linux tar command has a flag (-z lower case) which is not supported by AIX. The entry from the Linux site is as follows:

To uncompress bob.tgz, tar zxvf bob.tgz - If a folder was compressed originally, then the original folder will be created. If not, then the files will be placed in the current directory.

I hope this helps.

Thanks for the quick response!

1) okay, your saying that I have to find another installer that had been compressed in an AIX environment ant not in a .tgz format?

2) the weird thing is, I tried gunzip installer.tgz in another machine which is also AIX and it works. However when I try to > copy it to my local machine - success > ftp to my aix machine, it failed

+ btw, the method that I'm telnet to the AIX6.1 machine (64) is via putty.

did you use the binary mode to copy the files over ftp?

use cksum command on both aix machines, if the value is different you screwed it up with ftp

This won't work, because tar can only work on tar-files, not on gz-files. A ".tar.gz" file is a file in tar-format, which was packed into a ".gz."-file. (Think of it like a package wrapped into another package.) To unpack it, you have to unwrap one level after the other:

gzip -cd <file.tar.gz> | tar -xf -

gzip is asked to decompress (unpack) the file ("-d") and to send the result to <stdout> ("-c"), into a pipeline. At the end of the pipeline tar receives this file ("-f -") from <stdin> and further unpacks it ("-x").

There are two possible places where something might have gone wrong: when you transferred the file to your local system from the internet and when you transferred it from there with ftp. You made sure the second step is correct by using "bin" inside ftp, but maybe this error occurred in the first step. Download again from the internet and make sure you use "binary" there too when you do so.

You should be able to unpack the files correctly, even if you cannot run the unpacked executable. The tar-format and the gzip-format are both universal and the file(s) should unpack without problems. To *run* the resulting files is a different matter, of course. You will need *binaries* for your system, even if some shell-scripts(?) for installation purposes might be able to run on your architecture.

I hope this helps.

bakunin

1 Like

extract the tar archive in Linux or windows Box and copy it to AIX :slight_smile: very simple

Thanks guys for replying.

okay,

from my aix6.1
# cksum install.tgz
2945023227 28246184 install.tgz

from my server where i took the file
% cksum install.tgz
229238057 28246615 install.tgz

The file is definitely corrupted. Can you try use scp or sftp?

Hi, so I tried to use WinSCP to ftp the files. So i transfered the file to my AIX machine. Both from my pc and aix size were the same.

> then I tried the below at the aix (telnet)

# tar -zxvf Java5_64.sdk.tar.gz
tar: Not a recognized flag: z
Usage: tar -{c|r|t|u|x} [ -BdDEFhilmopRUsvwZ ] [ -Number ] [ -f TarFil e ]
           [ -b Blocks ] [ -S [ Feet ] | [ Feet@Density ] | [ Blocksb ] ]
           [ -L InputList ] [-X ExcludeFile] [ -N Blocks ] [ -C Directory ] File ...
Usage: tar {c|r|t|u|x} [ bBdDEfFhilLXmNopRsSUvwZ[0-9] ] ]
           [ Blocks ] [ TarFile ] [ InputList ] [ ExcludeFile ]
           [ [ Feet ] | [ Feet@Density ] | [ Blocksb ] ] [-C Directory ] File ...
# tar -xvf Java5_64.sdk.tar.gz
tar: 0511-169 A directory checksum error on media; 0 not equal to 58224.
#

:confused:

gzip -d filename.tar.gz
tar -xvf filename.tar

Could you, by any chance, at least readthe answers you get? Like the one i gave you, for instance?

Sigh....

bakunin

1 Like

hi bakunin, sorry didn't mean it that way, but hey I agree that something went up during my FTP from my local machine to the AIX.

It's kindda weird the ftp is not showing any error (normal ftp from command prompt)..

so what I did was, I ftp using WinSCP. and this time the file transfered to aix was able to be decompressed...using the commands suggested.

thanks again :b:

Bakunin was correct if this is a .gz file. However from your previous entries and the title of your problem this is a zipped tar file with the suffix .tgz. If this assumption is correct then as I said in previous entry this points towards a file created on a Linux server and will have to extracted on a Linux server using the tar -zxvf command.

So now which is it "install.tgz" or "Java5_64.sdk.tar.gz"? If it is the former then what I said above is correct, if it is the later then the file would have to be unzipped and then the tar -xvf command can be run!