How to Uncompress and Install Linux Downloads


Linux downloads come in a variety of formats which can be confusing to newcomers. Terms such as "tarballs" or "rpm's" can be difficult to understand. And even after unpacking the download, it is important to know if the file is a .rpm or a .src.rpm or some other format.


Tarballs, A Sticky Subject?

A "tarball" or a .tar file is simply a compressed archive containing several files. Its format would be "filename.tar" A .tar file can be further compressed using "gzip" or "bzip2". A tar file compressed using gzip would be in "filename.tar.gz" format. A similar archive would be .tgz format. If compressed using bzip2, it would be a .tar.bz2 format. A .tar file can be uncompressed using the command tar -xfv filename.tar. You can then "cd" to the directory created "cd filename" and you should file a file named README and another called INSTALL. These should contain directions on installing and using the downloaded program, Generally, the commands:

Will install the program. Please note that it is generally necessary to be a root user "su - root" to execute the "make install" command.
If the file is in "filename.tar.bz2" format, first uncompress it with the "bunzip2 filename.tar.bz2" After that, the directions are the same as for any other .tar file.

Summary of Compression and Related Commands

FunctionCommand
Create a .tar filetar -cvf filename.tar filename
Unbundle a .tar filetar -xvf filename.tar
List contents of a .tar filetar -tf filename.tar
List Contents of a .tar.gz filetar -ztf filename.tar.gz
Create a .tar.gz filetar -zcvf filename.tar.gz filename
Open a .tar.gz or .tgz filetar -zxvf filename.tgz or filename.tar.gz
Create a .gz filegzip filename.gz filename
Uncompress a .gz or .tar.gz filegunzip filename.gz
Zip (works w/ PKZip or WinZip) a filezip filename.zip filename
Uncompress a .zip fileunzip filename.zip
Compress a file to .bz2 formatbzip2 filename.bz2 filename
Uncompress a .bz2 filebunzip2filename.bz2
Split a file to fit on 1.44 MB Floppiessplit -b 1400000 filename
Rejoin Split filescat x* > OriginalFileName



Most Linux distributions also have a "zip" utility capable of "unzipping" files compressed using Windows' WinZip or PKZip programs. The command is simple unzip filename.zip. To compress a file using this program, the command is zip filename.zip filename where filename is the name of the uncompressed fileand filename.zip is the compressed file.


More commonly, Linux files are compressed using the gzip command and uncompressed using the gunzip commands. This pair of commands is found on most, if not all, Linux distros.

Red Hat Package Manager

Another common download file type is the .rpm or Red Hat Package Manager format. These files will either be in x86.rpm format or in .src.rpm format. To install a x86.rpm file, it is only necessary to type rpm -Uvh filename.rpm at the command line from the directory the file is located in to upgrade an existing package. To install a new package, the command is rpm -ivh filename.rpm. From there, the Red Hat Package Manager takes over.

If the file is a filename.src.rpm file, it can be installed by using the command rpm --rebuild filename.src.rpm

A RPM file can be said to have 3 parts, the package name, the version, and a file extension. A typical .rpm file name might be: somename-1-05-3.i386.rpm. In this example, I would refer to "somename" as the package and "1-05-3.i386" as the version. Using this convention, the following table lists a few of the options available with rpm:
Command
Function
rpm -ivh package-version.rpminstall new .rpm package
rpm -Uvh package-version.rpmupgrade existing package
rpm -qalist all installed .rpm packages
rpm -qi packageget more information on this package
rpm -ql packagelist all files that package installed on system
rpm -e packageremove installed package
rpm --rebuild package-version.src.rpmInstall a source rpm
rpm --rebuilddbrebuild the RPM database


Apt-Get and Synaptic for Red Hat

Apt-get for RPM is a really nice utility for Red Hat users. It allows a Debian-style package update or install. Combined with Synaptic, a GUI front end for apt-get, you have a really slick way of getting updates. The following links will get you everything you need to install and use these programs.


apt-get for RPM

And, if you insist on using a GUI for installs and upgrades, just type
apt-get install synaptic
and use the Synaptic front end for apt-get for this.

Return to Main Linux page