What a tar.gz file is and why you extract it instead of installing it

A tar.gz file is a compressed folder. It holds source code or program files bundled together and squeezed down to save space. When you read one, you are not downloading a ready-to-run program like you would on Windows or Mac — you are downloading raw materials that your computer has to unpack and then assemble.

The process has two parts: extract (unzip) the tar.gz file to see what is inside, then run the installation or setup commands that come with it. Most people get stuck because they expect one step, when there are really three or four. This guide walks through each one in order.

Key Takeaways

  • A tar.gz file is a compressed folder that you must extract before you can use what is inside.
  • Extract using the command tar -xzf filename.tar.gz in the terminal, which creates a new folder with the contents.
  • After extraction, read the README or INSTALL file in that folder to see what commands to run next.
  • Most programs need you to run ./configure, then make, then sudo make install in order.
  • If a command fails, the error message usually tells you what software you are missing and need to install first.

Opening the terminal and navigating to where your file is

You need the terminal to work with tar.gz files. Open it by pressing Ctrl+Alt+T on most Linux desktops, or search for "Terminal" in your applications menu. The terminal shows you a prompt — usually a dollar sign or hash mark — where you type commands.

When you read a tar.gz file, it usually lands in your Downloads folder. Type cd Downloads and press Enter to move there. Then type ls and press Enter to list what is in that folder. You should see your tar.gz file in the list. If the filename is long or has spaces, you can type the first few letters and press Tab — the terminal will finish it for you.

Extracting the tar.gz file

To unpack the tar.gz file, type this command and replace filename with the actual name of your file:

tar -xzf filename.tar.gz

Press Enter. The terminal will not show you a progress bar or a success message — it will just return to the prompt when it is done. That silence means it worked. Type ls again and you will see a new folder has appeared, usually with a name similar to the tar.gz file but without the .tar.gz part.

If you see an error like "No such file or directory", check that you typed the filename exactly right, including capital letters and any numbers. If you see "Permission denied", you may need to type chmod +x filename.tar.gz first, then try the tar command again.

Moving into the extracted folder and reading the instructions

Type cd followed by the name of the folder that was created. For example, if the folder is called myprogram-1.0, type cd myprogram-1.0 and press Enter. Now you are inside the extracted files.

Type ls to see what is in this folder. Look for a file called README, INSTALL, or INSTALL.txt. These files contain the actual instructions for that specific program. Type cat README to read it on screen, or cat INSTALL if that file exists instead. The cat command prints the file contents to your terminal so you can read the steps the program author wrote.

Most programs follow the same pattern, but some have special requirements or options. Reading the instructions first saves you from running the wrong commands and having to start over.

Running the configure, make, and install commands

The standard three-step process is configure, make, and install. Type them in this order, pressing Enter after each one:

./configure

This command checks your system to make sure you have everything the program needs. It may take a minute or two. If it finishes without errors, you will see the prompt again. If it stops with an error, read the error message — it usually tells you exactly what software is missing. For example, it might say "gcc not found" or "openssl development files not found". Write down what it says and install that package first using your system's package manager (apt, yum, or pacman depending on your Linux version), then run configure again.

Once configure succeeds, type:

make

This command compiles the source code into a program your computer can run. It may take several minutes depending on the program size. You will see lines of text scrolling past — that is normal. When it finishes, type:

sudo make install

This command copies the compiled program to the system folders where it belongs. The sudo part means "do this as administrator", so you will be asked for your password. Type it and press Enter. The program is now installed and ready to use.

Verifying the installation worked

After sudo make install finishes, the program is installed. To check that it works, type the program name and press Enter. For example, if you installed a program called myapp, type myapp. If it runs or shows a help message, the installation succeeded.

If you get "command not found", the program may have installed to a folder that is not in your system path, or the installation failed silently. Go back to the extracted folder and check the INSTALL file again — it may have instructions for a different step, or it may tell you where the program was placed. Some programs need you to type the full path, like /usr/local/bin/myapp, instead of just the program name.

Cleaning up after installation

Once the program is installed and working, you can delete the tar.gz file and the extracted folder to save space. Type cd .. to go back to the parent folder, then type rm -rf foldername to delete the extracted folder and rm filename.tar.gz to delete the compressed file. The program itself stays installed because it was copied to system folders during the install step.

If you ever need to uninstall the program, go back to the extracted folder (or extract it again) and type sudo make uninstall. Not all programs support this, but most do. Check the INSTALL file to see if uninstall is mentioned.

Frequently Asked Questions

What does the tar command actually do?

The tar command bundles files together and the gz part compresses them. The flags -xzf mean extract (-x), using gzip compression (-z), from this file (-f). You could also see tar -xzvf, where the v shows you each file as it extracts — useful if you want to watch progress on large files.

Why do I get permission denied when I try to run make install?

The install step writes to system folders that only the administrator can change. That is why you need sudo. If you forgot sudo, just type the command again with sudo at the front. If sudo asks for a password and you do not have one, you may not have administrator rights on this computer.

The configure step says I am missing gcc or build-essential. What do I do?

These are development tools your system needs to compile source code. On Ubuntu or Debian, type sudo apt install build-essential. On Fedora or Red Hat, type sudo yum install gcc make. On Arch, type sudo pacman -S base-devel. Then run configure again.

Can I install a tar.gz file without using the terminal?

Some file managers let you right-click and extract, but you still need the terminal for the configure and make steps. There is no graphical way around those. The terminal is the standard tool for this job because it is the same on every Linux system.

What if make fails partway through?

Read the error message carefully — it usually points to a missing library or a problem with your system. Search for that error message online along with the program name. Most common problems have solutions documented. Once you fix the problem, you can usually type make again and it will pick up where it left off.