Installing Packages from Source Code

team bbl


Sometimes it's necessary to install a package from source code. Perhaps the package you need is only available in source code. Perhaps you need the package installed with a configuration that's not available as an RPM. You can download the source code, compile it on your own computer, and install it.

Instructions for installing are available on the package home Web site and included in the package. In general, the procedure for installing from source code is:

1.

Download the source code file. Filenames are packagename.version.tar.gz. For example, the source code file for PHP could be named php-5.0.2.tar.gz. The directory /src or /local/src is often used to store source code.

2.

Unpack the tarball.

 cd /local/src gunzip -c packagename.tar.gz | tar -xf - 

A new directory called packagename is created with several subdirectories. Change to the new directory (e.g., cd packagename).

3.

Read any installation notes. Often you see files such as INSTALL.TXT.

4.

Set up the configuration files needed to compile. Type:

 ./configure  

Often you use options with the configure command, as follows:

 ./configure option option 

The installation instructions will explain the available options. Lines are output as the configure procedure runs. This step may take several minutes. If there's a problem, an information error message displays.

5.

Compile the software. Type:

 make 

You will see many lines of output. This step may take a few minutes. The executable files are created in this step.

6.

Install the software. Type:

 make install 

This step copies the files into the proper locations.

Some packages require additional or unique steps. Be sure to read the available documentation.

    team bbl



    Spring Into Linux
    Spring Into Linux
    ISBN: 0131853546
    EAN: 2147483647
    Year: 2005
    Pages: 362
    Authors: Janet Valade

    flylib.com © 2008-2017.
    If you may any questions please contact us: flylib@qtcs.net