What a .tar.gz file is and why you might need to install one
A .tar.gz file is compressed source code or a compiled program bundled into a single file. Ubuntu's package manager (apt) handles most software installation for you, but sometimes you need to install something that isn't in Ubuntu's official repositories — either because it's too new, too niche, or maintained by a developer who hasn't packaged it for Ubuntu yet.
When you read a .tar.gz file directly from a developer's website or GitHub, you're getting the raw files. Installing it means extracting those files to the right location on your system and, if it's source code, compiling it into a working program. This is different from clicking a button in a package manager — you're doing the work that the package manager would normally do for you.
Key Takeaways
- Extract the .tar.gz file using tar -xzf filename.tar.gz in the terminal, which unpacks it into a folder in your current directory.
- Read the README or INSTALL file inside the extracted folder first — it tells you what dependencies you need and the exact steps for that specific software.
- Most source code requires you to run ./configure, then make, then sudo make install in order, which compiles and places the program where Ubuntu expects it.
- If compilation fails, the error message usually names a missing library or tool — install it with sudo apt install and try again.
- Uninstalling software you compiled yourself is harder than uninstalling from apt, so only use this method when a package manager version truly isn't available.
Extracting the .tar.gz file to a working folder
Open a terminal and navigate to the folder where you downloaded the .tar.gz file. If it's in your Downloads folder, type cd Downloads. Then extract it with this command:
tar -xzf filename.tar.gz
Replace filename.tar.gz with the actual name of your file. The tar command unpacks the archive, the -x flag means extract, the -z flag handles the gzip compression, and the -f flag tells it which file to work on. After a few seconds, a new folder will appear in your Downloads directory with the same name as the archive (minus the .tar.gz part).
Move into that folder by typing cd foldername. This is where all the source code or pre-compiled files live. Before you do anything else, look for a file called README, INSTALL, or CONTRIBUTING — these files explain what this particular software needs and how to install it.
Reading the installation instructions for your specific software
Every .tar.gz file is different. Some contain pre-compiled binaries that you just copy to the right place. Others contain source code that needs to be compiled. The README or INSTALL file tells you which one you have and what to do next.
Open the README file by typing cat README or less README (press q to exit less). Look for sections titled "Installation", "Building", "Requirements", or "Dependencies". These sections list what you need on your system before you can proceed — often development tools like build-essential, git, or specific libraries.
If the README says "This software requires Python 3.8 or higher" or "You need the libssl development headers", install those first using apt before you try to compile. Skipping this step is the most common reason compilation fails.
Installing build tools and dependencies
Most source code needs a compiler and build tools to turn into a working program. Install the basic set with:
sudo apt install build-essential
This installs gcc (the C compiler), make (the build automation tool), and a few other essentials. You'll need to enter your password because sudo gives the command administrator privileges.
Next, install any dependencies the README mentioned. If it says you need libssl-dev, type sudo apt install libssl-dev. If it lists several, you can install them all at once: sudo apt install libssl-dev libcurl4-openssl-dev zlib1g-dev (space-separated). Ubuntu will read and install them automatically.
If you're unsure whether you have a dependency, try running the next step anyway — the error message will usually name what's missing, and you can install it then.
Running configure, make, and make install
Most source code follows the same three-step installation pattern. From inside the extracted folder, run these commands in order:
./configure
This script checks your system, looks for dependencies, and creates a Makefile — a set of instructions for the next step. It usually takes 10 to 30 seconds. If it fails, read the error message carefully — it will tell you what's missing.
make
This compiles the source code into a working program. It can take anywhere from a few seconds to several minutes depending on the size of the project. You'll see a lot of text scrolling past — that's normal. If it stops with an error, the message usually points to a missing file or library.
sudo make install
This copies the compiled program to system directories (usually /usr/local/bin) so you can run it from anywhere. You need sudo because these directories are protected. After this completes, the software is installed.
Verifying the installation worked
After sudo make install finishes, test whether the program actually works. If it's a command-line tool, try running it by name. For example, if you just installed a tool called myapp, type myapp --version or myapp --help. If it prints output, the installation succeeded.
If you get "command not found", the program didn't get placed where Ubuntu looks for commands. Check the README again — some software needs you to add its location to your PATH, or it installs to a non-standard location. The error message or the README will tell you what to do.
If the program runs but behaves strangely or crashes, check whether you installed all the dependencies correctly. You can also try running ./configure --help before the configure step to see if there are optional features you need to enable.
Uninstalling software you compiled yourself
Software installed from a .tar.gz file doesn't show up in Ubuntu's package manager, so you can't uninstall it with apt remove. Some projects include an uninstall target — try sudo make uninstall from inside the original folder. If that doesn't work, you'll need to manually delete the files.
Most of the time, compiled programs end up in /usr/local/bin. You can find where a command lives by typing which commandname, then delete it with sudo rm /path/to/file. If the software installed libraries or configuration files, those are usually in /usr/local/lib or /etc, and you'll need to find and remove them manually — this is tedious and error-prone, which is why using apt when possible is easier.
This is one reason to prefer package manager versions when they exist: uninstalling is one command, and the package manager tracks everything it installed.
Frequently Asked Questions
What does "permission denied" mean when I try to run ./configure?
The file doesn't have execute permission. Run chmod +x configure to make it executable, then try ./configure again. This is rare — most .tar.gz files come with execute permission already set — but it happens sometimes.
The make step failed with an error. What do I do?
Read the error message carefully. It usually names a missing file or library. Search for that name in apt: apt search libname. Install the development version (usually the one ending in -dev), then run make again. If the error persists, search the project's GitHub issues or documentation — someone else has probably hit the same problem.
Can I install a .tar.gz file without using the terminal?
Not really. Ubuntu's file manager can extract .tar.gz files by right-clicking, but you still need the terminal to run configure, make, and make install. There's no graphical way around these steps for source code.
Is it safe to install software from a .tar.gz file I downloaded?
Only if you trust the source. read from the official project website or a well-known repository like GitHub. Before running any script or command, read what it does — especially anything that runs with sudo. If you don't understand what a command will do, don't run it.
Why does apt install software faster than compiling from source?
Because apt downloads pre-compiled binaries — someone else already ran the configure and make steps and packaged the result. Compiling from source means your computer does that work every time. For large projects, this can take much longer.