EssentiaLinux.com          

Install Linux Software From Source

Question: What is Linux?

Installing Software From Source

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 softwares' 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 tars' "j" option:

$ tar -xjf downloadedFile.bz2

For gz files use tars' "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, anf 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 directory of the newly-created folder. This folder usually has the same name as the tarball which was just unpacked:

$ cd downloadedFile

And now we must 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 first become the super-user:

$ su # make install

After we are done, we logout to return our status to that of a regular user:

# logout

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

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

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

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