Thursday, December 16, 2004

Installing software on Linux

This article is the first in a series of articles about the many different ways to install software on a linux system. Installing software can be a simple task, or it can be a difficult task depending on a number of factors. New linux users have a bit more difficult time because many come from the end-user side of the Windows world. Single-user operating systems like Windows 95/98/ME gave users free unrestricted access to the entire system, the freedom to install any software, anywhere, and mess up the system completely. Linux is a bit more fussy. In order to install packaged software you need to become the "root" user.

If that isn't enough to confuse new linux users there are also a couple of package management formats, rpm, Redhat Package Management, and deb, Debian GNU/Linux package format. And then there are programs which are simply compressed source code, which further confuses new linux users. Well, the time for confusion is gone. This article will hopefully clear up some of the linux software installation mysticism.

To make things easier on new linux users many linux distributions include graphical software management tools. SuSE has yast2 yet another setup tool, and Fedora Core (and Red Hat) has up2date. The problem with these package managers is that they are limited to the software that is contained on the software source, usually a mirror of the distribution. This means new linux users miss out on a lot of great, cool software.

Learning the basics of installing software from the command line will open up a huge world of software to new users. To simplify things we'll leave compiling source code for another article.

As I mentioned earlier, there are basically two different formats linux software comes in: 1) .rpm, Redhat Package Management; and 2) .deb, Debian format. Some linux distributions use one format, some use another, and a few are capable of doing both.

Red Hat/Fedora Core, SuSE, and Mandrake linux all natively use software in .rpm format. All can be made to accept .deb, Debian files, but doing so requires installing more software.

Installing .rpm software can be as simple as opening up a terminal, changing to the directory where you downloaded the .rpm and typing:

rpm -iVh packagename.rpm

This assumes packagename.rpm is the name of the .rpm package you want to install. If the package is already installed rpm will notify you. Where people run into problems is when a program depends on another program. If you come from the Windows world and have been a Microsoft Windows users for some time you might have downloaded a program only to find that the program you downloaded requires a file called VBRUN300.DLL. Some linux software packages similarly require other files to run, these files are called dependencies. For example, before the multimedia package xine can be installed a package named xine-lib must first be installed. xine-lib actually depends on a number of other packages before it can be installed. Luckily, if the package you're installing depends on other packages, rpm will let you know which packages your program depends on.

If you're upgrading to a new version of a program the syntax for rpm is slightly different:

rpm -Uvh programname.rpm

That's the very basics of using the Redhat Package Manager. Let's move on to Debian packages.

If you have high speed Internet access Debian has a nice program called apt-get which takes care of downloading dependencies for you. If you know the name of the program you want to download simply type:

apt-get programname

If the program is in the Debian GNU/Linux archive apt will go out and fetch it plus all its dependencies and install them all in the correct order.

If you've downloaded a .deb package you use a different program, dpkg, to install the package. The format for this command is:

dpkg -i programname.deb

Not so difficult. Again, Debian packages might require dependencies. Unlike apt-get, the dpkg tool does not automatically fetch all a program's dependencies, so if you need to install a program that depends on other software you will have to install the other Debian packages first.

That's it for this introduction to software installation on a linux system. There are many tricks and shortcuts. It's important to remember that none of rpm, apt-get, nor dpkg will work correctly if you don't "su" to root first.

No comments: