How do I install a .tar.gz (or .tar.bz2) file?

The first thing you need to do is extract the files from inside the tar archive to a folder. Let's copy the files to your desktop. You can extract an archive by right-clicking the archive file's icon inside your file browser and pressing the appropriate entry in the context menu. Extracting the archive should create a new folder with a similar name. e.g. program-1.2.3. Now you need to open your terminal and navigate to that directory using the following command:

cd /home/yourusername/Desktop/program-1.2.3

Make sure you read a file called INSTALL, INSTALL.txt, README, or something similar if one was extracted. You can check if such a file exists from the terminal by using the ls command. The file can be opened and read with the command:

xdg-open INSTALL

Where INSTALL is the name of your file. This file will contain the right steps to follow to continue the installation process. Usually, the three "classical" steps are:

./configure
make
sudo make install

You may also need to install some dependencies if, for example, running configure prompted you with an error listing which dependencies you are missing.

You can also use checkinstall instead of make install.

Remember that your mileage may vary.


You cannot "install" a .tar.gz file or .tar.bz2 file. .tar.gz files are gzip-compressed tarballs, compressed archives like .zip files. .bz2 files are compressed with bzip2. You can extract .tar.gz files using:

tar xzf file.tar.gz

Similarly you can extract .tar.bz2 files with

tar xjf file.tar.bz2

If you would like to see the files being extracted during unpacking, add v:

tar xzvf file.tar.gz

Even if you have no Internet connection, you can still use Ubuntu's package management system, just download the .deb files from http://packages.ubuntu.com/. Do not forget to download dependencies too.

For an easier way to install packages offline, see the question How can I install software offline?.


How you compile a program from a source

  1. Open a console
  2. Use the command cd to navigate to the correct folder. If there is a README file with installation instructions, use that instead.
  3. Extract the files with one of the commands

    • If it's tar.gz use tar xvzf PACKAGENAME.tar.gz
    • if it's a tar.bz2 use tar xvjf PACKAGENAME.tar.bz2
  4. ./configure

  5. make
  6. sudo make install (or with checkinstall)

Download a package from the software sources or the software center.

If you install a package via the software sources and not downloading the package on your own, you will get new updates to that package and install them via the Update Manager.

You could just install MYPACKAGE by typing in a terminal:

sudo apt-get install MYPACKAGE

or by using the software center and searching for MYPACKAGE. But if it's not there go with the source.