Learning how to install tar.gz file in Linux is an essential skill for managing software from source. The .tar.gz file format is a tar archive that has been compressed with gunzip compression. These archives are designed to be opened on Linux systems and can contain any type of files within them. Sometimes, software comes packaged in a .tar.gz file, and users can extract its contents in order to install what is inside.
Normally, software comes in the form of a compressed archive whenever it is to be compiled from source. Whereas distributable binaries are normally installed through other means, such as via the system’s package manager. In this tutorial, we will go over the step by step instructions to install tar.gz file in Linux system.
In this tutorial you will learn:
- How to extract content from a compressed tar file
- How to install prerequisite packages to build from source
- How to configure, make, and install source files

| Category | Requirements, Conventions or Software Version Used |
|---|---|
| System | Any Linux distro |
| Software | tar, gzip, development tools |
| Other | Privileged access to your Linux system as root or via the sudo command. |
| Conventions | # – requires given linux commands to be executed with root privileges either directly as a root user or by use of sudo command$ – requires given linux commands to be executed as a regular non-privileged user |

INSTALLATION TIPS
Before proceeding with manual installation from source, always check the software’s README file or official website for specific installation instructions. The recommended approach is to use your distribution’s package manager whenever possible, as it handles dependencies and updates automatically.
MODERN ALTERNATIVES
Consider using modern package formats like AppImage, Flatpak, or Snap for easier software installation and management. These formats work across different Linux distributions and don’t require manual compilation.
Install prerequisites
To install software from a compressed archive, we will need the proper tools to extract the files and to compile the source code. We can use our system’s package manager to install these tools by executing the appropriate command below.
Ubuntu, Debian, and Linux Mint
To install tar extraction and compiling tools on Ubuntu, Debian, and Linux Mint:
$ sudo apt update $ sudo apt install tar gzip build-essential
Fedora, CentOS, AlmaLinux, and Red Hat
To install tar extraction and compiling tools on Fedora, CentOS, AlmaLinux, and Red Hat:
$ sudo dnf groups mark install "Development Tools" $ sudo dnf groupinstall "Development Tools" $ sudo dnf install tar gzip
Arch Linux and Manjaro
To install tar extraction and compiling tools on Arch Linux and Manjaro:
$ sudo pacman -Sy base-devel tar gzip
How to install tar.gz file in Linux
The recommended way to install software from source is to check the README file or official website for instructions. They may tell you to execute certain commands or include particular options, and may also reveal other prerequisite packages that are needed for installation in addition to the ones we showed you above.
With the disclaimer above out of the way, keep in mind that different packages may require a different set of instructions for installation. We will run through the most general steps that the majority of software packages follow for installation:
- Extract the archive: Start by extracting the contents of your archive using the tar command.
$ tar xf software-name.tar.gz
- Configure the build: Change into the extracted directory, and see if there is a file that we can execute named
configure. If so, execute it and follow the instructions on screen (if any).$ ./configure
- Compile the source: Next, use the make command to build and compile the software from the included source code files:
$ make
- Install on system: Then, to install the software on your system, run the following command. This part will require root permissions as we are installing software on the system.
$ sudo make install
These are general instructions that most programs follow for installation. But please note that the developer may have special instructions that need to be followed in order for the program to function as expected. It is impossible for us to predict exactly how to install your specific .tar.gz file that you have downloaded, so use the instructions above only as a general guide.
Closing Thoughts
In this tutorial, we saw how to install software from a .tar.gz archive on a Linux system. Software source files are normally distributed this way, and require the user to build and compile the code before finally installing it on the system. Various software will require a unique set of instructions, but in general, most software installation will follow the steps shown above, and sometimes with slight differences that may or may not have an impact on the final result. Definitely make sure you consult the readme file or official instructions for the exact process.