next up previous
Next: Selected GNU/Linux Web Sites Up: Getting Help, and Beyond Previous: Getting Help, and Beyond

Installing Software

When you download a software package, the program(s) may already be in binary form, or may be included as source code. In either case, a package is usually downloaded as a ``tarball'' (or ``gzip-ed tar file'') with the extension .tar.gz or .tgz, and the first step is to ``unpack'' it. Copy the file to a convenient directory; I do a ``test'' unpacking in the subdirectory Soft/test of my home directory, and then do the actual installation (as root) in /usr/local/src. To unpack the file sourcecode.tar.gz, type tar -zxvf sourcecode.tar.gz. This will usually create a directory whose name resembles the name of the software package, and usually contains a file called README or INSTALL. Do as it says.

Nowadays software is usually available in ``RPM'' (Red Hat package manager) format. An .rpm file is something like a Windows zip self-installing archive. The rpm utility has options for installing, upgrading, and uninstalling packages; see the man page for details. Tar files are frequently compressed using bzip2, a more efficient compression algorithm than gzip. tar does not yet support bzip2, so you must uncompress a .bz2 file manually before unpacking the tarball.

Computers and humans do not speak the same language. At a fundamental level, a computer understands only long strings of bits (binary digits, in files called binary executables), while human programmers typically write GNU/Linux software in a programming language called ``C'' that is more formal than English but still not suitable for a computer. The ``translator'' between a human-readable C program and a machine-executable binary file is a program called a compiler. The C compiler bundled with GNU/Linux is the Gnu C compiler, gcc. To compile software, you must have the appropriate development packages installed.

Newer packages can be compiled with a simple sequence of commands: ./configure, make, and make install. These commands are run from the directory where README is found; the README file should have detailed instructions. The ``configure'' step reads information about software on your computer (development libraries, paths to standard utilities, and the name, version, and location of the compiler) and writes a Makefile that tells the compiler how to compile the package. The make command runs the compiler, and usually generates many screens of color-coded messages that are informative if anything goes wrong.24 Doing make install copies the binaries just compiled to an appropriate system directory (often /usr/local/bin), and copies manual pages to another appropriate directory. Finally, running make clean will usually (safely) remove temporary files written during compilation.


I hope this guide is helpful in getting you better acquainted with your computer, and that you have an enjoyable experience with GNU/Linux!


next up previous
Next: Selected GNU/Linux Web Sites Up: Getting Help, and Beyond Previous: Getting Help, and Beyond
hwang
2001-10-31