Install tar.gz files on Linux Ubuntu. How to run tar command in Ubuntu to uncompress and install tar.gz/tar.bz2/rar packages in Linux Ubuntu 15.04, Ubuntu 14.04 and Ubuntu Derivatives.
Tar command is one of the most popular commands used bu Linux Users. It is a popular CLI (Command Line Tool) to archive, uncompress and install a compressed packages on Linux Ubuntu Systems. tar is the standard UNIX/Linux archiving application tool. tar is the GNU version of the tar archiving utility. tar accepts a lot of archiving filter with options. In simplest words we can say that tar stores and extracts files from a tape or disk archive.
The format of the tar command is:
The tar command has many arguments/command-options to use with. The first argument to tar should be a function; either one of the letters Acdrtux, or one of the long function names. A function letter need not be prefixed with “-”, and may be combined with other single-letter options. A long function name must be prefixed with –. Some options take a parameter; with the single-letter form these must be given as separate arguments. With the long form, they may be given by appending=value to the option.
Main operation mode:
- -A, –catenate, –concatenate
append tar files to an archive
- -c, –create
create a new archive
- -d, –diff, –compare
find differences between archive and file system
delete from the archive (not on mag tapes!)
- -r, –append
append files to the end of an archive
- -t, –list
list the contents of an archive
test the archive volume label and exit
- -u, –update
only append files newer than copy in archive
- -x, –extract, –get
extract files from an archive
How To Use TAR Command in Linux Ubuntu
The tar command in easy to use. It may or may not run with sudo privilege. Below are the three widely used formats of tar command:
- Create archive.tar from files foo and bar.
tar -cf archive.tar foo bar
- List all files in archive.tar verbosely.
tar -tvf archive.tar
- Extract all files from archive.tar.
tar -xf archive.tar
Install TAR Packaged in Linux Ubuntu
We shall use tar command to install a tar package on Linux Ubuntu systems. Firstly download the source archive (tar package) on your system. Now run the command to extract the tar package/directory.
To uncompress tarball packages, tar command can be used in the following formats, depending on the extension of the tar package:
tar zxf file.tar.gz
tar zxf file.tgz
tar jxf file.tar.bz2
tar jxf file.tbz2
Please note that you must have set the correct path to the directory before running the command. The default directory is HOME directory.
Once we ave extracted and uncompressed the package, we can install the software. In general, there are 3 commands for compiling and installing software:
Here is what these commands do:
./configure – configure the software. Check the system for all the necessary functionality and libraries to compile the package.
make – Compile the source files into executable binaries.
make install – Install the compiled binaries and supporting files.