Compiling and installing Mini Howto for linux. (I am using ubuntu 7.10 and kde)  :-)      Back to Main Page

This is a very short version, and if you want to know more, go to the Internet etc.

This howto is without any guarantee, and you may use it on your own responsibility only.

There may be errors, but I do not want to use too much time to  write this howto.

To check specific words you may try: http://en.wikipedia.org/wiki/Main_Page  (search).    

It is easiest to print this page out, and have it by your side.



Some programs are not existing as debian packages for various reasons, but can be downloaded as source tarball files (*.tar.gz or *.tar.bz2), and then compiled

and installed (really a debian package is a kind of automatic compiling and installation file).

A compiler (e.g. gcc) is a program, which transforms human readable text (source code made by a data programmer)

looks like this:
-----------------------------------------------
#ifndef HPROF_EVENT_H
#define HPROF_EVENT_H

/* From BCI: */
void event_object_init(JNIEnv *env, jthread thread, jobject obj);
-----------------------------------------------

into machine code (not understandable by humans - but understandable by a computer)

looks like this:
-----------------------------------------------
\�  `�  d�  h�  l�  p�  t�  x�  |�  ��  ��  ��  ��  ��  ��  ��  ��  ��  ��   ��!  U��S���    [��'  ��������t�N   ��  ��  X[���5$��%(�    �%,�h    ������%0�h   ������%4�h   ������%8�h
-----------------------------------------------


In order to show how a compiling and installation is done, I will download and install the "xprogram" program (a name made up - nonexistent).

Open a konsole and run the following commands:

mkdir /home/user1/xprog (creates a directory called "xprog" in my home directory)

cd /home/user1/xprog (change directory to "/home/user1/xprog")

wget http://xxxx.org/xprogram.tar.gz (downloads the "xprogram.tar.gz" tarball into the "/home/user1/xprog"  directory)

ls (check that the file is downloaded)

tar zxvf xprogram.tar.gz (unpacks the tarball and creates a directory, containing the source files, called "xprogram")

(If the tarball is of the tar.bz2 format run: tar xjvf xprogram.tar.bz2)

cd /home/user1/quad/xprogram (change directory to the "/home/user1/quad/xprogram" directory)

At this point you should open the files "INSTALL" and/or "README" if they exist, and read their contents, as they contain important information about how to

compile and install the program (same procedure with other tarball installations):

./configure  (configures the program for compiling)

make  (compiles the program)

sudo make install  (installs the program - has to be done as sudo)

Now the program should be installed and ready to use.

In order to view where the newly installed program files are placed, run:

sudo updatedb  (updates the locate database - takes a few minutes)

locate xprogram  (shows where alle the xprogram files are placed)

whereis xprogram (shows where the program binary, the filename used to start the program, is placed - typical /usr/bin/xprogram or /usr/sbin/xprogram)

env  (shows the environmental variables - look for lines like: "PATH=/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games" - paths shown here are

system paths, and you can call any program names contained in any of those paths without the path like: "xprogram" and not "/usr/bin/xprogram".

As the development of linux programs is going so fast, you will often meet problems when compiling programs, as the version of the source files and the gcc

compiler not always are compatible, so I have seen several times - and then you must be more than a newbie.

xprogram (starts the program)


Another example, using the graphic file manager for extracting a source tarball file - we will try to find and download the source of "gpodder":

In a konsole run:

mkdir /home/user1/gpodder (creates a directory called "gpodder")

Open the google search engine in a browser, and search for: gpodder software download (just an example)

Googling for gpodder

Then click on the third link "GPodder 0.9.5 download - GPodder" (see above):

click on: Download [ 0.9.5 ] :	http://prdownload.berlios.de/gpodder/gpodder-0.9.5.tar.gz

Then click on the green link:click on:  "http://prdownload.berlios.de/gpodder/gpodder-0.9.5.tar.gz " and again click on one of the Download links (see below):

Click on one og the downloads links, which then pops up
and choose "Save to disk" - OK:

Choose "Save to Disk" - OK

Then a dialog window shows that the tarball has been saved to "Desktop" (on my system):

Dialog shows "gpodder" has been saved to "Desktop"

Could look different on another system.

Then just move the tarball from the Desktop to the "gpodder" directory:

First open a Konqueror File Manager window:

Then click on the "Reduce windows size icon" Reduce size og window icon

Then reduce the window size by dragging with the left mouse cursor in the lower right corner of the file manager window.

Then place the window in a proper position on the desktop by holding the "alt" button down and dragging with the left mouse cursor anywhere in the window.

Next drag and drop the gpodder tarball file from the desktop into the gpodder directory (see below):


Drag and drop the gpodder tarball file from the desktop into the gpodder directory

Then leftclick on the "gpodder-0.9.5.tar.gz" tarball (see above), and a temporary directory with the source files are opened (see below):

Left click on the gpodder-0.9.5.tar.gz tarball file and a temporary gpodder directory are created

Now right click on the "gpodder-0.9.5" temporary directory (above) (see Location tar:/home/user1/gpodder/gpodder-0.9.5.tar.gz) and choose "Copy to" - Browse:

Right click on the temporary directory and choose "Copy to" - browse

Then choose "gpodder" directory - OK (see below):

Choose "gpodder" directory - OK

and the "gpodder-0.9.5.tar.gz" tarball file is extracted as a real directory "gpodder-0.9.5", containing all the source files (see below):

gpodder-0.9.5.tar.gz tarball extracted as a real directory in the gpodder directory ready to be compiled

Now the gpodder source source files can be compiled (./configure - make - sudo make install) as shown in the "INSTALL" file (in this case only "sudo make install"

is needed to be executed) (see the contents of the gpodder-0.9.5 directory below):

gpodder directory with files inclusive "INSTALL" files ready to be compiled

In order to proceed you should run the following commands in a konsole:

cd /home/user1/gpodder/gpodder-0.9.5 (change directory to "gpodder-0.9.5")

sudo make install (installs the gpodder program)

This is only an example showing the principle of how to download and extract a tarball file using a File Manager.

A lot of things in linux can be done in several different ways, so everybody has to choose what he/she likes the best!


11/2007