How To Install Tar.gz

Tar files are a collection of files wrapped up into a single file. Tar.gz files use the standard gnu zip(gzip) compression. Due to their portability, you don’t need any extra software to unbundle them in Linux/macOS.

Because of this, the source code of open-source software is generally packaged as tar.gz files. Using system-provided package managers is an easier way for installation. But, not all software is available across all Linux systems. Also, the type of licensing may prevent some applications from being available altogether. This is where the tar.gz build system comes in.

How to Install Tar.gz

How to Extract Tar.gz Files

You can decompress a tarball in one of two ways. Most Ubuntu-based distros come with the Archive Manager application. Use either one of these approaches as you see fit.

Extract Tar.gz Files Using Archive Manager (Ubuntu/kali Linux/ Mint/ Debian)

  1. Use your File Manager to get to the location of the file.
  2. Right Click on the file and click on Extract Here. You should see the Archive Manager extraction progress.
  3. After completion, you will notice a new folder created along with the tar.gz files.
  4. Open this folder in the terminal.Extracting tar.gz using Archieve Manager

Extract Tar.gz Using the Command Line (All Linux Flavours + Macos Any Version)

  1. Open the terminal.
  2. cd /home/foo/Downloads
    • Takes you inside the downloaded location.
  3. ls *tar.gz*
    • Finds any tar.gz files and displays the full filename.
  4. tar -xzf keepassx-2.0.3.tar.gz
    • Extracts from the tarball keepassx-2.0.3.tar.gz and creates a new folder with the same name.
    • Extracts (x) using the Gzip algorithm (z) of the file (f) named ‘keepassx-2.0.3.tar.gz’.Extract
  5. cd keepassx-2.0.3
    • Takes you inside the now extracted folder.
  6. ls
    • To confirm if the extraction completed successfully and to Check if you have a file or Cmakelists.txt file in this configure

How to Extract Tarfile in Windows

If you are using Windows 10 or newer, you can use tar utility from Powershell. If using an older version, you need to install extraction software to get files from tar.gz. This article lists some of the popular software used in Windows PC. 

  1. Type Powershell in Start Menu to open Windows Powershell.
  2. tar -xzf keepassx-2.0.3.tar.gz
    • Extracts (x) while being verbose (v) using the gzip algorithm (z) of the file (f) named ‘keepassx-2.0.3.tar.gz’.Extract Tar in Windows

How to Install Tar.gz File

For our purposes, we will examine the steps by installing a free application. The name of this application is KeePassX. Check their website for more information. 

After following the above steps, we have the files we need under /home/foo/Downloads/keepassx-2.0.3.

The concept of this process is easy to follow. 

Configure Make Install

First, we build our configuration, and then we compile it for our Operating System. This process applies to any distro or any flavor of Linux with all tarball applications. Of course, every application has different config files. But they all follow the above general pattern for the installation process.

  1. cd /home/foo/Downloads/keepassx-2.0.3
    • Takes you inside the extracted folder
  2. ls 
    • To look for an INSTALL/README file that contains detailed instructions.
  3. cat INSTALL
    • To read the contents of the file INSTALL. You can do the same for README too.CAT Install
  4. ls
    • To check if you have a file or cmake files/folders configure
  5. If found, just do ./configure and move to Step 10.
  6. If not found, you need to create a build folder to generate config files.
  7. mkdir build
    • To make a separate build folder
  8. cd build
  9. cmake ..
    • Configure using CMakeLists.txt file from directory one-level up into the current build folder.Cmake
  10. make
    • Starts building using the freshly generated config files.make
  11. sudo make install
    • Install into the system using the freshly built files from step 10.Sudo Make Install


What is Dependency Error When Trying to Run cmake or configure?

This means you don’t have the required dependencies installed in your system. If you look at the INSTALL file, you will be able to see the list of dependencies. For Ubuntu-based systems, use apt-get install to install dependencies as shown below. 

What Error Do We Get When Using cmake?

Cmake stores errors in CMakeError.log. This can happen when one or more dependencies are installed but don’t have the required versions. Refer to this article to install the correct versions of packages.

Error When Using ./configure?

Autoconf application is missing. Newer Ubuntu versions don’t ship autoconf utility by default. This can be solved by installing it as sudo apt-get install autoconf. 

If you want to read more about the source installation process, follow this website.

Add a Comment

Your email address will not be published. Required fields are marked *