Chapter 9: How do I install my new software?
Installing .tar.gz files (tarballs)
Installing .rpm files (red hat packages)
Installing .deb files (debian packages)
Installing .tar.gz. files (tarballs)
Tarballs come packaged in five main flavours:
Most of the time, you will be dealing with .tar.gz files, as they're a standard.
If you're familiar with .ZIP PKZIP/WinZip files on Microsoft platforms, .tar.gz files should be fairly easy to get the idea of, they work in pretty much the same way.
Here's how to extract a .tar.gz file in two different ways:
Okay, now you've extracted it, now comes the fun! - You gotta compile that mother!
It's pretty much expected that you are at the terminal to do this stuff, you can't really do it graphically. Drop down to an xterm or whatever and go into the directory that has been made by the package, eg:
$ cd /directory_that_the_tar_file_is_in
$ ls -l
-rwxr--r-- 1 user group 2907 May 21 17:15 mytarfile.tar
-rwxr--r-- 1 user group 0015 May 21 17:15 newdir/
$ cd newdir/
at this point, make sure you read the INSTALL file. You'll find that almost every tarball that you download (especially GNU software) has at least a file called INSTALL, COPYING, README and CHANGES
Most of the time the INSTALL file says the same thing, it's a generic process for installing tarballs, but if a program requires to be compiled in a special way, you'll find out in either INSTALL or README.
If you were installing a generic program, extracted from a tarball and presuming that we just changed into our directory, as above, we could do the following to compile the program:
(Take good notes here for any configure errors)
(Take good notes here for any compile errors)
$ make clean
(this cleans up after a sucessfull compile)
and that's it. Sounds pretty easy, and in theory, it should be. But it dosen't always work. Most of the times this is because of dependencies on other programs. Picture this scenario: You attempt to install tar.gzipped game called xtux.
The game bombs out during a ./configure, and you noticed on the web site and also from the output of the ./configure something about SDL. You're not quite sure what it is, but you go onto freshmeat.net anyways and type in SDL. You find out that SDL is infact a popular graphics library for X and that it's necessary for xtux.
You download SDL-1.2.3.tar.gz from the SDL website and install that tarball. It installs fine, so you try installing xtux once more. It still bombs out, but this time it gives you a different message: could not find Qt => 1.3 on a ./configure. You check your system for QT version 1.3 or greater. You have 1.3.4 so you should be fine. Why is this error coming up? Well, it's probably because Qt (which is another graphics / programming toolkit) is installed, but is not in the folder that ./configure is looking in. You can edit ./configure yourself to see if there is anything you can do to amend the situation yourself, or try removing Qt, and installing another instance of it from another source.
I find that RPM based distros often put stuff like Qt in places that a normal tarball dosen't, so that's often the reason for these compile problems.
Installing RPM files (red hat packages)
Thankfully, Red Hat, one of Linux's first ever distributors came up with a neat solution to the problems .tar.gz files and compiling has for the normal user. They precompiled a tarball on their own systems, and included standard configurations, so much less configuring was required. This system is called RPM. At the time of writing, RPM is at version 4.0.3, and you can download the latest version of RPM from www.rpm.org.
Note: you will need RPM 3 to install RPM 4 and so on, so make sure that your distro can at least support RPM before you begin.
If you have a RedHat based Distro (otherwise known as an RPM based distro), you can happily install RPM packages straight away. RPM based distros include Red Hat linux, Mandrake, SuSE and Definite Linux amongst others. If you are unsure if you have RPM installed and running on your system, or you just want to check what version of RPM you are using, then try typing the following at the shell:
$ rpm -q rpm
You should get a similar answer:
If you get something like 'command not found', then it sounds like you don't have RPM installed. Eeek!.
Finally, when you go to get an RPM, always try to get one that was packaged by the vendor of your distribution, for example, if you go to rpmfind.net and type in netscape, and you get 3 RPMs back: One from Red Hat, one from Mandrake and one from Connectiva, and you have a Mandrake Linux distribution on your PC, use the Mandrake one. The reason for this is all down to fitting into your exising configuration structure, which varies from distro to distro.
How to install the package it's self
Okay, let's presume that you've been to rpmfind.net already, and you've got yourself an RPM, called netscape-4.76-3.i386.rpm
You can install it in the following ways:
The only reason you should get any problems when installing is through dependencies. Unlike it's tarball counterpart, RPM makes counteracting dependent programs a breeze, you need only take note of the program(s) that the RPM is dependant on and make another visit to rpmfind or wherever and download the dependant RPM. Install that, and retry installing the first RPM again. It should install fine.
Installing .deb (Debian packages)
Second to RPM in popularity, Debian's package management system is actually a suite of command-line tools:
Now that you know what the main Debian DEB tools are, we'll step through installing a Debian package at the shell:
#dpkg --install package-name.deb
That should be the package installed, although again, there are dependencies to think about, and as with RPMs, make a note of any dependency errors, download the appropriate DEB package(s) to meet the dependenc(ies) and try again.
Both DEB and RPM are much, much better at dealing with dependencies, so as long as you can find the dependency in question, there should be little problem in resolving a dependency based problem for either RPM or DEB.
For more information on DEB, try debian's DEB Package-basics HOWTO
If you've installed your tarball, RPM or DEB package and you want to run it and you don't know how to, move over to chapter 10 - Managing my files