How To Extract And Install A Tar.gz File On Ubuntu

Tar.Gz files are archives, and you can easily install them through the GUI in Ubuntu or by using the terminal One of the things you’ll come across during everyday use … Read more

Taylor Bell

Taylor Bell

Published on Apr 25, 2024

How To Extract And Install A Tar.gz File On Ubuntu

Tar.Gz files are archives, and you can easily install them through the GUI in Ubuntu or by using the terminal

A photo of the extracting file archive in Ubuntu

One of the things you’ll come across during everyday use of a great Linux distribution like Ubuntu is installing apps and opening certain files. While most apps can be found in the Ubuntu Software Center or even as manual downloads, there might be a time when an app or a file you want will come as a tar.gz file type.

This is an archive of files, almost similar to ZIP on Windows 11 and other operating systems. It combines both the TAR (which is known as tape) archive and the ZIP archive format into one, so the data is compressed and reduced in size. Naturally, you’ll need to extract the tar.gz file to install or open whatever is inside. We’ll guide you through that today in two easy ways, covering both the GUI and the terminal app.

You don’t need a lot of technical knowledge to open a tar.gz file on Ubuntu. The operating system has native support for opening and managing this file type through the Files app.

1. Open Files.

2. Navigate to where the tar.gz archive is saved. (If downloaded from a website using a browser, check the Downloads folder.)

3. To view what the files are without extracting the archive, right-click on the file and click Open with Archive Manager.

A screenshot of the dialogue to open with archive manager

4. To properly open and install the files, return to the originally downloaded file, right-click, and choose Extract to.

A screenshot of the dialogue to open with archive manager

5. Pick a location.

6. Click Select.

A screenshot of the location to extract a file to in Ubuntu

Once you pick a location, navigate there once the process has completed and you should see a new folder with all the extracted files waiting for you.

If you’re more technical, you can also open and exact a tar.gz file by using the terminal. This is easy, provided you know the path for the downloaded file.

1. Open Terminal.

2. Extract the tar.gz archive (replace file.tar.gz with the archive name):

tar -xvzf file.tar.gz
A screenshot of the extraction for a Tar.gz file in the terminal in Ubuntu

If the archive isn’t in your current directory, you can use the following command to automatically extract it without moving to the right folder.

tar -xvzf file.tar.gz -C /path/to/file

Remember to replace file.tar.gz with the archive name and /path/to/file with the correct values. The files will be extracted to the current or specified directory on your Ubuntu install and you can open it to discover the files. For the flags we’ve used in the above command:

  • -f is specifying the file name.
  • -v is listing the files while extracted.
  • -x means what to extract the files from.
  • -z is what’s compressed.

Another simple Linux operation!

As you can tell, it’s pretty simple to extract and install tar.gz files on Ubuntu. For most people, the GUI method will do the trick, but if you’re up for adventure, it’s always great to mess around with the terminal and enter commands.

Partager cet article

Inscrivez-vous à notre newsletter