ComputersSoftware

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 point that it was necessary to create a solution on the basis of 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 a lot of software products went to the market - WinZip, WinRAR and others, firmly entrenched in this niche. These tools were relevant for the family of Windows operating systems. In Linux, the same environment was actively used archives bzip2, Gzip and tar. It is about the bunch of the last two that will be discussed in this article.

What is tar and gz

Tar is an archive format that can store important information such as file owner data, folder structure, and more. The same program, installed on Linux systems, works with archives of the tar type. In this case, you can not compress tar files yourself. Therefore, to reduce the size of the resulting archive, it uses third-party compression products. Most often it's gzip or bzip2.

The gzip archiver uses the Deflate method for compression, which allows you to effectively reduce the size of files without loss. The only drawback of gzip is its inability to work simultaneously with multiple files. 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." In this way, many browsers are actively using this technique to compress traffic.

How to install tar.gz - archive or program

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

For example, you can download the hello application, the download of which is publicly available. This product performs one simple function - 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 one.

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

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 example:

Cd Downloads

After entering the command, the Enter key is pressed, which sends it to execution. Now the terminal is in one folder with the downloaded file hello-2.10.tar.gz. The command tar zxvf hello-2.10.tar.gz is entered. Its result is the output to the console of the list of all the extracted files.

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

Preparing program files

First you need to be back in the same folder as the unpacked files. To do this, use the cd command with the directory specified - hello-2.10. Now in the folder itself you need to run the command ./configure --help. It will give you hints on how to install the program. In most cases, a simple introduction to ./configure is sufficient. However, the user may not have enough access rights to install to the default directory, which is / usr / local. Therefore, you need to specify that the application should be installed in the system's home folder. The overall team looks like this:

./configure --prefix = $ HOME

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

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, then 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 everything has been installed into the system, and it can be used. But before that, it's worth noting that if you specified the home directory as the installation path, you would add it to the PATH environment variable as follows:

Export PATH = $ HOME / bin: $ PATH

Now the program compiled and installed into the system can be launched from any directory by a simple hello call.

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

How to install tar.gz on Linux Mint

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

  • Download directly tar.gz itself;
  • How to install tar.gz and unpack it, has been described a little above;
  • Running configure, make, and, if necessary, make install;

Basic tar commands

The tar program actually has a lot of features, the implementation of which is available with options. You can view their full list by calling tar --help in the terminal. For simple unpacking, use the tar -xvf path to the archive. If you need to specify which folder to do this, the -C option is added: tar -xvf the path to the archive -C the path to the destination folder. Keys used in the team mean the following:

  • -z. This key indicates that you need to skip this archive through the gzip program;
  • -x. Means, actually, the very unpacking;
  • -v. It says that when the command is executed, the entire process listing will be displayed;
  • -f. This means that you need to extract the archive local file;

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

The basic commands of gzip

The gzip program can also be used separately, for compressing or unpacking files. To create an archive, you need to run the gzip filename command. Conversely, to unpack - gunzip filename.gz.

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

  • -h. Using this key will result in outputting 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 creating the archive. Best is the best compression quality, but slower. Fast - on the contrary, very quickly, but with a smaller percentage of archiving.

Conclusion

In this article, we looked at the simplest commands and showed how to install the tar.gz archive or program into the system. This method is similar to both Ubuntu and Mint, and for a number of other Linux distributions.

In fact, the capabilities of the tar and gzip programs are much wider, and more detailed study of them is beyond the scope of this article.

Similar articles

 

 

 

 

Trending Now

 

 

 

 

Newest

Copyright © 2018 en.unansea.com. Theme powered by WordPress.