Programs with the tar.gz extension: how to install, step-by-step instructions and recommendations

The first appearance of Internet networks was marked by low speeds and unstable connections. It was at this moment that it was necessary to create a solution based on which it would be possible to transfer files and documents in a compressed form to save network traffic . Many approaches and algorithms have been tried. And then many software products entered the market - WinZip, WinRAR and others, which are firmly entrenched in this niche. These tools were relevant for the family of Windows operating systems. On Linux, the bzip2, Gzip, and tar archives were heavily used. It is about a bunch of the last two that will be discussed in this article.

What is tar and gz

Tar is an archive format that is capable of storing important information such as data on file owners, their folder structure, and much more. The program of the same name installed on Linux systems works with tar archives. At the same time tar can not compress files independently. Therefore, to reduce the size of the resulting archive, it uses third-party compression products. Most often it is gzip or bzip2.

tar gz how to install

The gzip archiver uses the Deflate method for compression, which can effectively reduce file size without loss. The only disadvantage of gzip is its inability to work with multiple files at the same time. Therefore, in order to create an archive, it is combined with the tar utility. Thus, to compress multiple files, tar first creates one archive file from them, which is then compressed by gzip.

Another interesting feature of gzip is the ability to compress files, as they say, "on the fly." Thus, this technique is actively used by many browsers to compress traffic.

How to install tar.gz - archive or program

On Linux, and in particular on Ubuntu, many files and programs are sometimes provided as tar.gz archives. It can be applications, service packs or just executable files. Therefore, all further description will be given for the Ubuntu operating system. To understand how to install tar.gz archive in Ubuntu, you can take any program that comes with source code as an example.

For example, you can download the hello application, the download of which is publicly available. This product performs one simple function - it welcomes the world in the best traditions of the first lessons of any programming language. Among the versions presented at the address, it is better to choose a fresher.

So the file has been downloaded, but how to install tar.gz? Very simple. On operating systems like Ubuntu, you need to use a terminal. You can call it by pressing Ctrl + Alt + t. Its window looks something like this:

how to install tar gz in ubuntu

In order to unzip the file, you need to get to it. In the terminal, this can be done using the cd command and the desired directory. For instance:

cd Downloads

After entering the command, the Enter key is pressed, which sends it to execution. Now the terminal is in the same folder with the downloaded hello-2.10.tar.gz archive. The tar zxvf hello-2.10.tar.gz command is entered. Its result will be a list of all unpacked files on the console.

how to install a program from tar gz

Now the task comes to the main point in the matter of how to install the tar.gz archive in Ubuntu - preparation and compilation.

Preparing program files

First you need to be back in the same folder with the unzipped files. To do this, use the cd command with the required directory - hello-2.10. Now in the folder itself you need to run the command ./configure --help. She will give tips on exactly how to install the program. In most cases, a simple introduction ./configure is enough. However, the user may not have enough permissions to install in the default directory, which is / usr / local. Therefore, you need to specify that the application should be installed in the home folder of the system. The general command looks as follows:

./configure --prefix = $ HOME

As a result of its execution, the system will check all the dependencies and at the end will give a few lines about the successful creation of files.

how to install tar gz archive

Compilation

Now it remains to compile the prepared configuration. This is done by a simple make command in the same directory of the unpacked archive. If the output does not contain errors, it means that the compilation was successful, now it remains to understand how to install the program from tar.gz to the system. To do this, use the make install command. If it also does not contain errors, then it means that everything was installed in the system, and it can be used. But before that, it is worth considering that if the home directory was specified as the installation path, then you need to add it to the PATH environment variable as follows:

export PATH = $ HOME / bin: $ PATH

Now the compiled and installed program can be launched from any directory with a simple call to hello.

install tar gz package

In fact, it was possible to install just this program by simply calling apt-get install hello in Ubuntu, since it is contained in its repositories. But the main message of the article was to tell how to install the tar.gz archive. Therefore, the hello program was a kind of experimental rabbit here. He just showed how to install the tar.gz package. We also learned how to unpack it, compile and run it in the system.

How to install tar.gz on Linux Mint

Work in Mint is not much different from Ubuntu. Unless the call of the terminal can be reassigned to other keys. In general, the algorithm for installing the program from the tar.gz archive will be the same:

  • downloading directly tar.gz itself;
  • how to install tar.gz and unpack it was described a little higher;
  • running configure, make, and, if necessary, make install;

Basic tar commands

The tar program actually has many features, the implementation of which is available through options. You can view their complete list by calling tar --help in the terminal. For simple decompression, use the tar -xvf archive path. If you need to specify which folder you want to do this, then add the -C switch: tar -xvf archive path -C destination folder path. The keys used in the command mean the following:

  • -z. This key indicates that you need to skip this archive through the gzip program;
  • -x. It means, in fact, the unpacking itself;
  • -v. Says that when the command is executed, the entire listing of the process will be displayed;
  • -f. Means that it is the archive local file that needs to be unpacked;

Also, before unpacking, you can view the contents of the file with the tar -tf archive path.

Basic gzip commands

Gzip can also be used separately to compress or decompress files. To create an archive, you need to run the gzip file_name command. And vice versa, for unpacking - gunzip filename.gz.

In addition to standard commands, there are keys that expand the functionality of the program. The main ones look like this:

  • -h. Using this key will lead to a list of available options and commands;
  • -q. Blocks all messages that appear during operation;
  • -t. This key checks the archive for integrity;
  • -fast and -best. These two keys control the speed of archive creation. best - best compression quality, but slower. Fast - on the contrary, very fast, but with a lower percentage of archiving.

Conclusion

In this article, the simplest commands were examined and how to install a tar.gz archive or program into the system was shown. This method is suitable for both Ubuntu and Mint, as well as for a number of other Linux distributions.

how to install tar gz in linux mint

Actually, the possibilities of tar and gzip are much wider, and a more detailed study of them is beyond the scope of this article.

Source: https://habr.com/ru/post/K23531/


All Articles