Friday, 12 January 2007

A short HOWTO - Installing Softwares

Linux does not have the setup.exe like Windows. On the contrary they have many brilliant or sometimes rather boring and tiring approach. All depends on where and in which form you get the software. Let me describe to you some of the popular approaches.

On the RedHat and many derived platforms including SuSe and mandrake(now Mandriva) as also Fedora, the main installation program that has been for ages is the 'rpm'(Redhat Package Manager). You need to download your package(software) and store it somewhere. Use the rpm command to install it. The rpm command is very simple:
rpm -ivh packagename.rpm
-i Install
-v Verify before install
-h Use Hashes [ ###### ] to show installation progress
packagename.rpm the package that you are installing

Optionally, You may replace the -i with an -U if you are upgrading the package, as it will throw error messages otherwise. If you ever come across a dependency issue and you have the dependency package in the same folder then just add an -aid in the end.

The removal of the package is simpler.
rpm -e packagename
You do not have to use the rpm or even keep the rpm package. If you have installed the package that is enough. Just use the command from anywhere on the command line.

The Debian based ditros used a tool called dpkg to install .deb files. If you ever lay your hands on a .deb file issue this command to install it:
dpkg -i filename.deb
is Install

There is a new way to install softwares without even downloading them and without having to worry about the dependencies. this is called the repository based update. All of the Red Hat based distros depend on a tool called yum(Yellow dog Updater, Modified). As you may have guessed, it was originally designed for the Yellow dog Distro of Linux and was then named yup. The new yum has now replaced the original yup in Yellow dog and is being used by almost all RedHat based distros and support repositories of each other to some extent. The tool that Fedora uses is called yum and so is the one used by CENTOS, Yellow dog and many other RedHat clones. The one used by RHEL is called up2date and can handle both yum and apt repositories. SUSE has it integrated with YaST and OpenSUSE entirely uses a yum repository. The simples t way to install using a yum is
yum install packagename

The graphical tools using yum are:
  • KYum
  • pirut
  • Yum Extender
  • YaST2
A similar style has also been adopted by the Debian Side as well. The tool that they use is called APT(Advanced packaging Tool) APT was originally designed as Debian's tool for their dpkg tool to install .deb packages. There are many front-ends to this tool. The one that you would usually come across at the command line is called the apt-get which works exactly like the yum. The command for installing using apt-get is:
apt-get install packagename

The graphical tools used instead of apt-get are
  • Adept Package Manager
  • KPackage
  • Synaptic Package Manger
The most difficult way to install a package is when you have the source code of the package and not the binary. This is the time when you need to compile it. These packages usually come in the form of .zip, .tgz, .tar.gz, formats.

So let me guide you to identify and extract these packages first before you move with the installation part.
.zip is as usual a Compressed ZIP file using a zip tool so just use unzip to unzip it.
unzip filename

and .tar.gz are gzipped tarball. So you need to gunzip it and untar it to extract it. This is done by
tar -zxvf filename.tgz and tar.bz2 is a bzipped tarball and you need to use bunzip it and untar it. This can be done by replacing the z above command with j.
tar -jxvf filename.tar.bz2

Next, look for files like README or INSTALL to get hint on how to install the specific software. If not follow these steps. Most of the packages are built this way. Usually you will find that there is a file named Makefile in the main folder. You will also find a file called configure. configure will help you to identify the variables specific to your machine so that the package can be optimised for it. It will also find the required packages. You have to install the following commands one after the another; ignore the garble you get but watch for error messages, if any.
make install
make clean

./configure will create the configuration files for you
make will compile the entire package.
make install will install the package
make clean will clear the source folder of all the compiled files.

Now that you have learnt all the ways to install the softwares on Linux, go find yourself a package and start installing. If you are scared of the command line, go use the Synaptic Package Manger, KPackage, YaST2 or Yum Extender.

Enjoy the new power that you have learnt today....

No comments: