Setup from a source file

final

Peace be upon you:

Our article today is about install programs and applications from their source code in Ubuntu .

Requirements: basic knowledge about APTand Packages.

======

1) why install from the source?

some programs don’t exist as .deb package, so the default way is the program come in source code and can be used on different distributions and different OS’s.

2) How can i differentiate between the package and the source code files?

The package file come with extension .deb , .rpm , .tgz , .bin, but the source file come with extension .tar.gz , .tar.bz2 , .zip

and after extract it you will find files like README ,INSTALL , configure , makefile.

3) How can i install a program from package file or a source file?

from package file just let your dpkg work by double click on the package will finish your installation.

from a source file it is what the article talked about.

4 stages and you will finish your installation from source:

Stage #1 >> preparation :

just extract the source file with your desktop environment or with your terminal

tar xvzf  fribidi-0.10.9.tar.gz

tar xvjf  fribidi-0.10.9.tar.bz2

unzip fribidi-0.10.9.zip

it will generate a new file called  fribidi-0.10.9 so run in terminal:

cd fribidi-0.10.9

Stage#2 >> read instructions and sure from the dependents :

every program to run need a libraries so how you know the libraries needed?

* read the instructions on the web site which you download the file.

* read the README , INSTALL file.

some things is required to install from source:

GCC, build-essential (for distributions which based on debian),make,g++ , automake , autoconf , glibc-devel

Don’t started without be sure that you provide this requirements and the program dependencies.

Stage#3 >> Installation :

a) the configuration operation

run in terminal:

./configure

this command task is to be sure that the program requirements and libraries are exist.

if the requirements and libraries are exist a new file will be created called “MakeFile”.

if not an error message will appear.

NOTE : There’s a possibility that you don’t have a configure file. Anyway,still you have autogen.sh ,Type ./autogen.sh to generate configure file.

b) the Build operation

run in terminal:

make

here the program be built .may this operation take a long time depends on the program size.

c) The installation operation

run in terminal

make install

Stage#4 >> clean :

run in terminal

make clean

task: to remove the unneeded files after installation.

to remove your program run in terminal

make uninstall

====

Disadvantage of setup from source:

the main problem is in the Stage#2 because the program may want a lot of  libraries and this libraries want another libraries so the Stage will become recursion :D so in some times this Stage become impossible.

so there is the magic stick  PMS (Package management system ) like APT,RPM and yum.

this tools save your time and your efforts to bring the program to you and install it.

====

Methods can help you to install from source:

1) if you want a source file from a repository you have :

to bring the source file from the repository run :

sudo apt-get source programName

and to install the source file run :

sudo apt-get build-dep programName

if you want to make a package to this source file run :

dpkg-buildpackage -rfakeroot

you can install the .deb package that you made by running :

sudo dpkg -i programeName.deb

2) if you have a source file you can use the tool “auto-apt” run :

sudo apt-get install auto-apt

and redo the 4 stages but with this commands with the same arrange :

auto-apt run ./configure
make
sudo make install

this tool make Stage#2 more Easier by bring the Headers that your program need.

======

so that’s it any feedback is welcomed

Best wishes,

aboelnour.



2 Responses

  1. Allah Yenawar ya Abou El Nour :D eh el 7alawa di , we el sho3′l el gamed da , Keep going
    M.Ramzy

Leave a Reply