Javatpoint Logo
Javatpoint Logo

Install tar.gz Ubuntu

If we are using Ubuntu Linux, we will later or sooner find ourselves faced with the operation in which we need to install a tar.gz file. In this article, we will discuss how to install a tar.gz file on the latest Ubuntu versions.

Introduction to tar.gz File

Tar can be defined as a software utility in computing to collect several files into a single archive file. Often, it is known as a tarball and used for backup and distribution objectives. The term tar is considered through (t)ape (ar)chive. Usually, a tar archive includes the .tar file suffix that is package.tar.bz2,, package.tar.xz, or package.tar. Also, the word tarball is used for referring to the tar file.

A file containing an extension, i.e., tar.gz can be described as an archive file. It means that this file includes single or multiple files in it which can be compressed into one archive file. Various tar.gz files are the same as the ZIP files.

Essentially, not all the tar.gz files that we trigger on Ubuntu include an installable application. Many tar.gz files could be used for several other types of objectives like storing a group of documents. Then, do not assume that only because we have a tar.gz, we can install its software.

It is worth noting as well that sometimes applications are packaged into many files using extensions that are the same as the tar.gz (however, not identical).

Some key points are discussed as follows:

  • Tar is not an installation package. It is a system software utility to collect several files into a single archive file.
  • Often, tar is used together using a compression technique like gzip for creating a compressed archive and file.tgz (or file.tar.gz) as well.
  • Tarballs are used for distributing an application's source code or probably a binary file for executing a program.
  • We should find a substitute before installing the tar.gz package as sometimes this process is a little tougher and longer.
  • Basic examples include tar.xz and tar.bz2 files. These types of files work almost in a similar way as the atr.gz files.
  • But, the primary difference among them is a tool used for compressing the data in them.
  • We will focus on the tar.gz file as follows since the tar.gz file is probably one of the most famous formats of archive files on Ubuntu.

How to install tar.gz files in Ubuntu?

There is no one way for installing the tar.gz file in Ubuntu because the data in a tar.gz file could take various different formats. There are instead several methods we should consider.

We will explain all the methods below, beginning with the easiest methods to install a tar.gz file.

Using a Debian package rather

The easiest method for installing a tar.gz file in Ubuntu is not to install these files at all. However, rather than installing an application, we wish with the help of a file of the Debian package.

Debian packages (file names end with .deb)are another method of packaging various applications for Linux Ubuntu and the same operating systems. It is preferable for installing an application with the help of the Debian package rather than a tar.gz file, for some reasons:

  • Everything we require to install and execute an application will be built-in with the Debian package. We do not need to overthink about compiling the source code, which we typically need to do while dealing with the tar.gz files.
  • Debian package can be installed easily. We can usually install them using some clicks with the help of various graphical tools.
  • If we install the Debian packages in Ubuntu Software Center from a repository, then Ubuntu will update that application automatically for us whenever a new release becomes available.

Therefore, before going to start installing our tar.gz file, check if we can use a Debian package rather. First, find the Ubuntu Software Center. If the application is not available there, then check the official website of the application to check if it provides a Debian package to download.

Once we have downloaded a Debian package, then we need to right-click on the application and choose an option, i.e., "Open with Software Center" for installing it from the Software Center. Also, we can install the application using the terminal with the dpkg command.

See tar.gz for instructions on the installation

Our next step is to see the tar.gz file to check if it contains instructions about how to install an application. We can do it by opening an Archive Manager application in Ubuntu. Also, this application is sometimes known as File Roller, and we can execute it from the terminal by entering the file-roller if we can not find any graphical launcher.

For instance, here's what we will see if we download a tar.gz installation package (which only happens to be a program to create and open tar.gz files).

We will notice it includes a file which is known as INSTALL. It provides detailed instructions of installation for an application if we open this file. If there is no such file with a term such as INSTALL, then look for a file, i.e., README instead. Installing an application in such a case is as efficient as below the instructions.

The steps for installation of the tar.gz files could vary widely relying on what type of code we are dealing with. Though, in most cases, we will need to implement two common steps before we can pursue any other instructions of installation.

  • Extract a tar.gz file to any folder on our computer. We can do it by pressing a button, i.e., Extract in the upper-left side of the Archive Manager.
  • On Ubuntu, install a build-essential package. We can do it in command-line using the sudo apt-get install build essential command. This package includes software we will require to compile source code, that is usually (although not always) needed for installing the tar.gz file in Ubuntu.

Use Make for installing the application

Sometimes, we will find the tar.gz file that includes source code, no installation instructions. In such a case, we can try executing generic commands, i.e., Make installation. Typically, source code is aimed to be compiled for Ubuntu and installed with a program known as Make. Hence, there is an opportunity that whoever made a tar.gz file aimed for it to be installed by Make, even when it does not come with instructions.

First, ensure that we have already extracted a tar.gz file and installed a build-essential package for installing by Make. Open the command-line window and enter the command, i.e., cd for navigating to the folder in which the extracted data of the tar.gz file is stored.

For instance, if we extracted the tar.gz file data to any folder on our desktop named "my file", we would execute the following command:

Install tar.gz Ubuntu

From here, enter the following:

Install tar.gz Ubuntu

The above command will configure the source code. Thus, it could be compiled on our system. We may be prompted a few questions about how we wish to create the application, or we may not, relying on what type of source code is created to do.

Enter the following:

Install tar.gz Ubuntu

It will compile source code. It can take time for the process to finish if we are dealing with any large application.

Run the following command finally:

Install tar.gz Ubuntu

The above command will copy the code that we compiled in Ubuntu so that we can run it.

Again, do not expect it to work for all tar.gz files we may wish to install. However, it is the process we can expect to pursue in general.

If it fails...

If we have tried everything and still can not get our tar.gz file, then we suggest checking online guidance tailored to our application.

Also, remember that installing applications using the tar.gz file in Ubuntu or other Oses is not exactly a task of beginners. It is complicated and subject to several variables that it could be an irritating procedure even for many experienced users.

Now, the Ubuntu ecosystem is fortunately so rich that including installing various software using tar.gz is rare now these days. Almost every application that executes in Ubuntu has existed as Debian packages. However, when we do trigger any tar.gz file in Ubuntu, then the guidance which is compiled as above with a bit of luck, will give what we need to install it.

Youtube For Videos Join Our Youtube Channel: Join Now


Help Others, Please Share

facebook twitter pinterest

Learn Latest Tutorials


Trending Technologies

B.Tech / MCA