Decompressing Software

Many software packages under development or designed for cross-platform implementation may not be in an RPM format. Instead, they may be archived and compressed. The filenames for these files end with the extension .tar.gz, .tar.bz2, or .tar.Z. The different extensions indicate different decompression methods using different commands: gunzip for .gz, bunzip2 for .bz2, and decompress for .Z. In fact, most software with an RPM format also has a corresponding .tar.gz format. After you download such a package, you must first decompress it and then unpack it with the tar command. The compressed archives could hold either source code that you then need to compile or, as is the case with Java packages, binaries that are ready to run.

A compressed archive is an archive file created with tar and then compressed with a compression tool like gzip. To install such a file, you must first decompress it with a decompression utility like gunzip utility and then use tar to extract the files and directories making up the software package. Instead of the gunzip utility, you could also use gzip -d. The next example decompresses the htdig-3.2.6.tar.gz file, replacing it with a decompressed version called htdig-3.2.6.tar:

# gunzip htdig-3.2.6.tar.gz

You can download compressed archives from many different sites, including those mentioned previously. Downloads can be accomplished with FTP clients such as NcFTP and gFTP, or with any Web browser. Once downloaded, any file that ends with .Z, .bz2, .zip, or .gz is a compressed file that must be decompressed.

For files ending with .bz2, you would use the bunzip2 command. The following example decompresses a bz2 version:

# bunzip2 htdig-3.2.6.tar.bz2

Files ending with .bin are self-extracting archives. Run the bin file as if it were a command. You may have to use chmod to make it executable. The j2sdk software package is currently distributed as a self-extracting bin file.

# j2sdk-1-4.2-FCS-linux-i386.tar.bin

0 0

Post a comment