Although every major desktop linux distro has both command-line and GUI package management tools, sometimes we need or want to install from source. The steps involved are downloading the necessary files, uncompressing them, configuring, and two make processes. I will not describe the process of downloading the necessary files, usually that is done in a web browser from the software's home page or via wget. If you know the address of the files you need, then by all means use wget:

$ wget http://website.com/folder/tarball.bz2

Now, you must unpack the tarball. For bz2 files use tar's "j" option:

$ tar -xjf downloadedFile.bz2

For gz files use tar's "z" option:

$ tar -xzf downloadedFile.tar.gz

In addtion to the "j" or "z" option, we gave tar the "x" and "f" options. The option "x" tells tar to actually extract the files, and the "f" option tells tar to use the file that we specified. You can also add the "v" option to have tar tell you everything that it is doing. Now, we must change into the newly created directory which conviniently usually has the same name as the tarball which was just unpacked:

$ cd downloadedFile

And now we configure the installation script:

$ ./configure

We then make the installation script:

$ make

And finally, we run the script that will install the program. Of course, Linux won't let regular users do something like that, so we either use sudo (Ubuntu) or first become the super-user, run the install, then switch back to standard user. This is what the command looks like in Ubuntu:

$ sudo make install
witching windows and one

And this is what the commands look like in distros that do not support sudo:

$ su
# make install
# logout

In short, there are the steps for installing software compressed in bz2 files:

$ tar -xjf downloadedFile.bz2
$ cd downloadedFile
$ ./configure
$ make
$ su make install

And there are the steps for installing software compressed in gz files:

$ tar -xzf downloadedFile.tar.gz
$ cd downloadedFile
$ ./configure
$ make
$ su make install

Note: This page was originally published on EssentiaLinux.com which is no long operational. Grammar and typos were corrected when moving the page.

Date Published on DotanCohen.com: 2009-03-08