how to install tar.gz or tar.bz2 files/packages in ubuntu

If you’ve been using Ubuntu for a while then you might noticed that ‘all applications do not come with a native debian package (installer.deb), in that case you will have to install the application from the archive or the source code itself’. Installing packages from source code is not so difficult, in fact it’s quite easy; all you need is some build tools (e.g make) and what ? nothing.. just relax (Oh! you should at least know how to execute commands in terminal, if you don’t, then – Learn basic Linux Commands from Google Code University (it’s free and openly available for all) and come back here to begin).

In this article you are going to learn about installing applications from tar.gz or tar.bz2 packages (commonly called as tarball), in few simple steps, on Ubuntu [11.04/11.10/10.10/10.04…] (Although it should also work on other Linux distributions such as Linux Mint, Fedora, OpenSuse, Debian, CentOS etc with little or no change). Before moving to the actual steps first let me explain you little about tar files. tar (name comes from tape archive) is a file format as well as the name of program which handles compression/decompression of those formats. GNU tar is the default application in most of the Linux based operating systems including Ubuntu. Tar is typically used with some compression/decompression software such as gzip or bzip2.tar.gz

tar.gz is the most commonly used archive format for distributing source code for open source softwares, tar.bz2 archive is also used in the same way (Firefox uses bz2 format). How the packages will be installed it varies according to the application but a common/generic steps would include –

Installing tar.gz/tar.bz2 packages in Ubuntu

step #1 : After you got the source code, extract it, using following commands (it will extract it in the same directory)

for tar.gz type :

tar -xvzf source_code.tar.gz

for tar.bz2 type :

tar -jxvf source_code.tar.bz2

step #2 : Move to the directory, Read the readme file to go further (if necessary). Some applications may have installation script such as install.sh or something like that, you just need to execute that script using

cd source_code


command. If it’s the source code then you may need to first configure it by using the command –


step #3 : Now use a build automation tools such as make to create executable from the source code; it scans makefiles to get instruction on how to derive target file.


step #4 : Now install the application using the command (followed by your login password) –

sudo make install

Recommended Reading(s)

  • GNU Tar – Official website contains more details about the tar although you can also use tar --help command from your terminal for quick help.
  • Make – Wikipedia page explains about the build automation tools make.
  • nagendra

    thnx alot!!

    • Mallappaktrc2010

       we have problem with octave3.6.1

      where i can open octave

  • David

    No wonder Linux didn’t get anywhere. I didn’t need to go to the “MS Windows University” to learn to dubble-click on a file to install it???? Holy crap, what  a nightmare!

    • Anonymous

      You are kidding ? Right, i think so, because Linux is everywhere – super computers (90% share), Servers (80%), and personal computers – it’s growing very fast, well; did I forget to add Android phones and tabs (as they are primarily based on Linux kernel).

      • R Heschel

        rkjha, your missing the point.

        I got a copy of Win7, dropped it in the Dell lap, it booted, loaded all the latest drivers and configured the hardware. Not one hickup. Dropped the disk into the old Dell desktop, same thing. HP Lap? Same thing. Most difficult thing about loading software is , do I choose 32 or 64 bit? Download a program, click it and watch it load.

        Thats pretty much how Ubuntu worked in the two laps, long as I stay with the repositories and a handler. Except for losing the number pad on the external board …

        Not so much with Debian on the Dell with mainstream hardware. Glad I had a second source for research, none of the interfaces worked. the Realtec nic was mis configured, the centrino wlan wasn’t even seen, and a very important packet wasn’t installed. Joys.

        Now, rkjha, about numbers … yeah, the web runs on linux/unix, what about it? 99.99% of computers aren’t super or servers and don’t have full time It Pros to babysit them. You’re comparing oranges and lumps of coal.

        On a larger note, aside from the false comparison you drew, validation doesn’t come from numbers. In anything.  Following you’re own logic nothing but MS matters, and the people on Wall Street are doing good because they make money.

  • Mahfuzncb

    i am trying to install a tar.gz2 file, but it says:
    system1@system1-OptiPlex-GX620 ~ $ tar -jxvf MPlayer-1.0rc4.tar.bz2
    tar (child): MPlayer-1.0rc4.tar.bz2: Cannot open: No such file or directory
    tar (child): Error is not recoverable: exiting now
    tar: Child returned status 2
    tar: Error is not recoverable: exiting now
    system1@system1-OptiPlex-GX620 ~ $
    whats the problem?plz solve it.

  • RussKev

    Oh for Gods Sake, can’t Linux figure out how to install using Single, Double Click, or right Click?

  • JJ Lee

    Hi can anybody help me how to install newer version of gnucash-2.6.2.tar.bz2 into ubuntu 12.10. Thanks