How To Install .tar.gz Or .tgz Packages In Linux

Linux is the operating system with more kinds of packages. Surely, if you have used Debian, you should know the file type .deb, or maybe, if you have used Fedora, you should know the file type .rpm. In Linux, we have many file types when we talk about installation packages, and surely, you know the format .tar.gz.

Before we continue, we’d like to tell you about Contabo. We host LinuxAndUbuntu on Contabo VPS. Check them out if you need web hosting. Prices start at $6.99 per month for an 8GB RAM and 4 Core CPU VPS. 

contabo vps

What is .tar.gz or .tgz?

​Tar isn’t an installation package but a computer software utility for collecting many files into one archive file. It is often referred to as a tarball for distribution or backup purposes. So .tar.gz is just a file format.Tar is often used together with a compression method, such as gzip, to create a compressed archive and file.tar.gz (or file.tgz).

Tarballs are often used to distribute the source code of an application or maybe a binary file to execute a program. You should consider finding an alternative before installing a tar.gz package because sometimes the process is longer and tougher.

How to install .tar.gz or .tgz file in Linux

If you need to install a .tgz package, don’t worry, we have the solution, and you’re going to know it through an example:

I need to use WaoN because I play the guitar and want to transcribe the audio to a midi file, but WaoN isn’t available for my distro. So, I have downloaded the source code to my computer, and I have extracted the tarball’s content.

extract tar.gz or tgz file in linux

​To extract the files of a tarball, you can use the command: tar xvf tarball.tar.gz. Also, you should find more information about Tar here.

Now, enter into the extracted directory:

cd into the tar extracted directory

​Commonly, the tar.gz package contains a file with the instructions to compile and execute the program. My package contains a file called ‘INSTALL’ with the instructions:

read text file using cat command

​In other cases, you’ll find a ‘configure’ script. This script is a tool to check if your system has all the dependencies required for the building. If you find a ‘configure’ script, you must execute it: ./configure (also, you should check the file permissions).

If the output of the ‘configure’ script doesn’t report any problem, you can continue with the next step.

configure tar.gz program in linux

​To build a package, you must use the program make: make -arguments. More about make here.

Finally, I get an executable file:

install executable file in linux
compile tar.tgz package in linux

​Now I must execute my program. In most cases, you’ll install the program on your computer, so you must use the command ‘make install’. Other tarball packages contain a binary file, for example:

Sublime Text is available for Ubuntu, but it doesn’t provide a version for my distro, so I have to use the tarball version (the file type isn’t tgz, it’s a tar.bz2 file).

check tarball file in linux

​It takes the same process, extracts the file.

extract tar file in linux

I found the executable file of sublime text, but I checked the file permissions to execute the file. If your file doesn’t have permissions, you can modify the permissions using chmod

sublime text editor in linux

​Finally, execute the program. There are many possibilities when you install a tarball package. So you must analyze your situation and install your package; it’s easy, pay attention to your package. Also, when you use .configure command, if you have any dependencies issue, you’ll be asked to install the dependencies. That’s all there is to install .tar.gz or .tgz files in Linux. If you have any problem installing the packages through this method, let me know in the comment section below. I’ll help you out.


Mohd Sohail is a web developer and a Linux sysAdmin. He also loves to write how-to articles, applications reviews and loves to use new Linux distributions.

Articles: 849


  1. I need some help/clarification.

    I am trying to extract file “sqlitestudio-32.1.tar.xz

    and I tried your example “tar xvf sqlitestudio-3.2.1.tar.xz”

    I get error messages:

    Cannot create symlink to ‘’ : Permission denied

    and, there are many more error lines that followed this one.



Leave a Reply

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