Friday, July 21, 2006

Installing applications in Linux

Linux Application Installation Made Easy

You already know that due to its open source nature, Linux comes in many colour, shapes and flavors. In fact, you too can distribute your own customized version of Linux. Different versions of Linux may offer you different benefits, but, often they pose problems due to lack of unified standard, or too many good of them. In any computing system, the best way to install an application is to compile them in the particular hardware environment where it is intended to run. But it is not possible always since you may not have required compilers and other development environment installed in your computer. Hence there remains only option to use precompiled binaries, the easily installable, and ready to run executable files to install applications. Different Linux distribution handles application installations differently. RedHat uses RPMs whereas Debian uses deb packages. Further, Linux applications are written on equally many different SDK and development environments such as GTK, QT or WxWindows and hence needed some specific files and libraries pre-installed in the system intended to run. In MS Windows platform, applications are bundled with all the dependent files and therefore they are installed along with their all required dependent dll files. That is why, in MS Windows, application installation is always a few click affair. Linux users had always wanted Linux application installation, a few mouse click affair like its windows counterpart. In Linux, till a while ago, application installation was quite a nightmare for everyone since it needs to address file dependency issues, version conflicts and all that. But, thanks to today’s advanced auto installers that do everything automatically for you, and in some cases, they seem better and easier than their counterpart in MS Windows.

Add Remove applications in Linux:

As explained earlier, the best way to install an application in Linux is to compile its source. Linux sources are available as compressed tar gzipped or bzipped files. To install application through its source, copy or download the source in a directory you think appropriate and then decompress them. For example, if you have source file in tar gzipped format, say, source file of package xawtv, the Linux TV player, xawtv-3.93.tar.gz, then the command to unpack it will be:

# tar -zxvf xawtv-3.93.tar.gz

And if you have source file in bzipped format say, xawtv-3.93.tar.bz2, then the command will be:

# tar -jxvf xawtv-3.93.tar.bz2

Both the command will create a directory containing all the source files called xawtv-3.93 in current directory. Now change to this directory and see the directory listing. You will find many files and directories there. You will also find a script file called configure. Now give following command:

# ./configure

If you had installed necessary development environment including compilers, make, automake tools etc in your computer, then it will start compiling necessary information and creating necessary make files. If this command finishes without errors then give next command:

# make

This command should also finish without any error massage. Note that depending upon your computer’s processing power; these commands will take some time to complete. Finally, change to root user mode by giving su command if you are already not in super user mode, and then give following command to install executable files at appropriate directories.

# make install

If you believe in cleanliness, then do not forget to give following command to remove junk files created by above commands but not needed any more:

# make clean

If you think every thing has gone smoothly, then you can run the application by giving its name as command (in general), here, xawtv. In some cases you may find program menu entries automatically added, else you have to add them manually.

RedHat's Add-Remove application:

As you observed above, installing applications by compiling them needs lot of resources and time. Hence it is better to install precompiled binaries. RedHat uses binary RPM packages to install applications. RPM files can be installed / uninstalled with powerful rpm command which comes with many options and switches, but here again, you will encounter lot of difficulties like file dependency, version conflicts etc., and often they are beyond scope of an average user to handle.

To address difficulties in installing and uninstalling application in Linux, many tools have been devised. For example, RedHat had simplified adding and removing application through a graphical package management tool which you can access (in RedHat's Fedora Core 2) from Start > System Settings > Add/Remove Applications. When you start this tool, it will ask you for a root password. Give the valid one and it will scan your current system package status for a while and show a status window from where you can select applications for installation or uninstallation. Here, you will find that you are bound with the entries already there and if you want to install other applications not listed there, you are helpless. Despite this, it is fairly good tool to add remove standard set of popular applications. Simply select the individual application for installation or uninstallation by expanding the Details menu entry in various sections & subsections such as Desktop, Applications, Development, System, Server etc within Add/Remove Application window, and then click on Update. It will then ask for required CD-ROM or Address from where it can access rpm files. This tool is not much efficient and intelligent in handling file dependency, and despite having all the required files, it may refuses to install certain application giving file dependency error.

This tool lets you install application from locally available distribution CDs that contains rpm files in a preset hierarchy. It can not address dependency problems itself and hence if you do not have required dependent files preinstalled, you can not install applications with this tool. This tool does not allow you to install application automatically by addressing dependency problem. You need to force install dependent files manually. To address dependency problems automatically, some package installation tool have been devised for other Linux distribution, for example, Debian´s Apt which have now been ported to RedHat and can be effectively used in Fedora core 2 installation.

Ximian's RedCarpet:

This tool also lets you install Linux applications automatically either through Internet or from local folder containing application installer files. It handles file dependency beautifully, however, it does not have support for Fedora core 2 as of now, and hence it has limited use. You need to install Redcarpet package in your system to use it.

Mandrake's Rpmdrake

Mandrake has tweaked RedHat's package management tool and simplified and refined it to a great level. It is more efficient than RedHat's Add-Remove application. Still, this tool does not handle dependency problem efficiently, and at times you can not use it on other popular distribution like RedHat Fedora core 2 effectively.

Gentoo's Emerge

Emerge is package installation tool for Gentoo Linux. It is similar in working as Debian's Apt tool. Emerge is essentially an on line package installation tool that works exclusively to Gentoo and is presently not available to other popular Linux distribution like Fedora core 2.

Debian´s Apt : The universal Add/Remove tool

Debian´s Advanced Package Tool, Apt is a powerful tool that makes application installation and un-installation a child’s play, provided you have Internet access. Apt has also been effectively ported to other Linux distribution like Fedora Core 2 and has many graphical front-end to make it further easy in use. Apt essentially comes preinstalled with Debian, and you have to install it for other distribution, such as Fedora Core2. Download Apt rpm/source package (currently apt-0.5 version available to download from various mirrors) and install it. Then run following command after connecting to Internet:

# apt-get update

This will update the package list from predefined web address specific to the platform it is running. For example, if it is running from Debian installation, it will search for Debian specific application, and if it is running from Fedora Core2, it will update applications specific for Fedora Core2. When done, you are ready to install application by giving following simple command:

# apt-get install xawtv

If xawtv rpm files are ported for Fedora Core2 and are available as per entries available in updated application list of apt, then it will download and install all the files, dependent files etc. automatically. If you are not comfortable in using command line, you can use many graphical front-end tools for Apt. One such tool is Synaptic. To use Synaptic, you need to install it. Give following command to install synaptic through Apt:

# apt-get install synaptic

When done, run Synaptic, the graphical front end tool by giving following command:

# synaptic

It will scan your computer for available/installed applications, and display the result in explorer like window. You can then select packages for installation and uninstallation by simply clicking on them. Finally click on Apply button to install selected packages. Synaptic will download packages along with dependent files, install them in your computer and in some cases, add program menu entries in program menu too.

Synaptic lets you install only those packages that are made available in predefined web address that are available in apt´s updated config files. If you want to install new applications or applications that are not available in Apt´s list, then you have to install them manually.

Autopackage

Autopackage is a concept devised by Mike Hearn, the young developer from Britain. Keeping in mind the functionality of MS Windows installers, Autopackage has been developed. All the necessary files are essentially ported with Autopackage installer itself, thus the package becomes distribution independent. Therefore, problem like file dependency / version conflict etc. will not arise, and if arise at all, they will be handled automatically.

Autopackage is software that lets you create binary packages of software for Linux that will install automatically, interactively on any Linux distribution through multiple front-end. It also has built in Uninstall / Repair tool that lets you uninstall and repair an already installed software through Autopackage. When the Autopackage installer file is run to install a certain software, it checks the system for the installed component the software in question needs, installs it if it finds in its installer files or downloads and installs it from internet (similar as Debian’s Apt) if it does not find it locally.

This concept is in infant stage, and you can find a few applications Autopackaged already. You can download Autopackaged Ink Scape 0.39, Gimp 2, Zile, Super Tux and a few other software installers from http://autopackage.org/downloads.html . Autopackage is not designed for distribution management, but it has been made to install individual piece of software like Games, Graphic utilities, word processors etc. with ease. For more info, you can see http://autopackage.org/faq.html . A similar tool called A-A-P (see http://www.a-a-p.org/ for details) that lets you go a step further by making application installations Operating System independent has also been devised. A-a-p lets you install an application in either MS Windows, Linux (all variants including Unix) and MacOS.

Let us see how far Autopackage will go and if it will start running really, then a new chapter will be written in Linux world.

Screen shot Descriptions:

Synaptic01 Synaptic, the graphical front-end to Apt, the application installer gives you detailed information about package that you want to install/uninstall.

Synaptic02 Synaptic is downloading necessary files from Internet. Entire process is automated and transparent.

Synaptic04 In Synaptic window, you can see other package information like file dependency etc.

Synaptic09 RPMdrake, the package management tool for Mandrake Linux.

Synaptic11 RedHat´s package management tool: Add Remove Package, the gui frontend to rpm tool lets you some standard application installation with a few mouse click.

4 comments:

Antonie said...

Hi there

Thanks for putting up these great guides. I'm just having some trouble figuring out which compilers I have to install in order to install xawtv.

Any advice will be appreciated.

SKV said...

Thank you,
After all I have downloaded OpenOffice and what exactly button I should press to have it installed?
I am USER not developer.

Raviratlami said...

skv,

can you give me the name of file you downloaded?

unnikutan!!! said...

thanks for the information....... let me try......

More Articles...

Translate in your own language

Want to translate this article in your own language? Just click the Flag below