Sunday, November 28, 2010

Installing programs in Linux easy and hard way

Many Linux beginners come into a question about how to install a program in Linux.This question has been solved dramatically using an inbuilt Package Manager.But still one should learn how to install programs manually because the precompiled packages sometime didn’t work.I have faced a great problem when software manager fails to resolve dependencies error.
So the best approach would be to compile the program manually.
For that there are some prerequisites that needs to be fulfilled.
  • A compatible GCC compiler(Opensuse installs it when you select Base Development packages during the installation)
  • Make(Included in Development packages)
You can search for these packages in your favorite Package Manager.
Just for example,you have downloaded the VLC tarball(vlc-1.1.5.tar.bz2) .The steps involved are
  • Extract the files anywhere.
  • Open the directory in terminal.(Open in  terminal can be added in Nautilus by adding a software plugin gnome-open in terminal)
  • Type 'sh configure' without the inverted commas and wait for it to run.
  • If any dependencies are missing,then it will show the name.Search for it on the internet and download the file and install it using steps mentioned here.
  • If everything is ok,the script will make new files and exit.
  • Now run 'make'
  • It will compile the program.
  • After run 'sudo make install'
  • It will install the program onto required directory.
Here 'sudo' command is used to switch between root privileges.Some Linux versions like Ubuntu use 'su -c' instead.
Configure is a script that checks for prebuilding requirements and make a makefile which is used by make program to compile and install the program.
Remember:
Don't delete the directory after installing the program because it will be necessary if you want to uninstall the program that you have installed manually.
A program can be uninstalled by issuing the command 'sudo make uninstall' on the same directory.
 




0 comments:

Post a Comment