Installing programs in Linux

When you get a Linux program, it's usually in a .tar.gz (or .tgz) file, which is a TAR archive that has been further made into a GZIP archive. Before anything else, you must uncompress these archives, just like you need to uncompress a ZIP in DOS before you can use the files in it. The usual way of handling .tar.gz files in Linux is with this command:

gzip -cd filename | tar xfv -

(Where filename is the filename of the .tar.gz file.) The x option tells tar to extract the archive (it must be the first option). The v option tells tar to be verbose (so it provides more info).

Note that newer versions of tar have a "z" option which lets you filter the file through GZIP first, which allows you to just use a plain tar command instead of having to pipe gzip output through tar. So, the new method for extracting .tar.gz files in Linux is with this command:

tar xfvz filename

Much simpler, isn't it? Again, filename is the filename of the .tar.gz file.

Because of all the varieties of different Linux kernels and configurations, rarely do you just download a program and run it, as you would do with DOS. Rather, Linux programs, once you unzip them into some directory, are usually installed using three commands. In the order you should run them, they are:

./configure
make
make install

The "configure" command configures the program to your system in preparation for building it. The "make" command builds the program, compiling the source code into binary executables. And then "make install" actually installs those executables. This is the standard procedure for installing any Linux program which comes in source code form.

A final, fourth command is optional: "make clean". This command usually removes any temporary files created during the previous three commands. This is not necessary for the program to function, but it gets rid of the files you don't need anymore and saves some disk space, so it's good practice to run it when you're done.

Back to PC Procedures

Back to the main page


This page hosted by Get your own Free Homepage
1