How to Install a Tarballed (.tar.gz) Application or Program in Linux

I’m doing my best to follow DRY (Don’t Repeat Yourself) in all things. So rather than having a ‘this is how you install a Linux program from a tarball’ in all of my setup tutorials, here’s a reference post!


Step 1: Download the .tar.gz File

A tar.gz file is known as a compressed tarball, which is similar to a zip file. While a zip file is a compressed bundle of files, a .tar by itself simply bundles files together, while the .gz provides compression.

For me, Mozilla has been putting these files in Root/tmp/mozilla_user, which is a little obnoxious. To change this I went to Firefox Preferences > Downloads/Save Files > Browse > Home/Downloads



Step 2: Move the Tarball to the Desired Location

A common location for user applications is the /opt/ directory. NOTE: You can use *.tar.gz to move all files ending with .tar.gz from your Downloads directory to the /opt/ directory. Maybe you’re installing multiple programs at once!


Step 3: Untar the Tarball

Note: zxvf means:

  • z: (un)z̲ip
  • x: ex̲tract files from the archive
  • v: print the filenames v̲erbosely
  • f: the following argument is a f̱ilename

Maybe this will help:


You can now delete the tarball if you wish.


Step 4: Rename the Directory to Something Reasonable


Step 5: Run the Installation Shell Script

There will typically be a file ending in .sh. It may be at the new_name directory root, or housed in the new_name/bin directory. This is your installation shell script. To run it, enter:


Step 6: You’re On Your Own From Here: Program Specific Setup

Follow the usual program setup steps at this point.


There you have it. Not terribly earth-shattering, but hopefully somewhat useful as a reference!

Matthew Odle

Indie dev, autodidactic polyglot, lover of programming, dad, musician, writer, mentor

Join the Discussion