Home arrow Site Administration arrow Page 5 - Linux Administration: Installing Software

Looking for Documentation - Administration

Three basic software installations are covered here -- using the Red Hat Package Manager, compiling software using the standard GNU compilation method, and compiling and installing the software by hand. (From the book Linux Administration, A Beginner's Guide, third edition by Steven Graham and Steve Shah, McGraw-Hill/Osborne, 0072225629, 2002).

TABLE OF CONTENTS:
  1. Linux Administration: Installing Software
  2. Installing a New Package
  3. Uninstalling a Package
  4. Compile and Install GNU Software
  5. Looking for Documentation
  6. Installing the Package and Testing the Software
  7. Common Software Problems
  8. Cleanup and When There is No Configure Script
  9. Compiling and Installing a GNU Program
  10. Project Summary
By: McGraw-Hill/Osborne
Rating: starstarstarstarstar / 32
November 02, 2004

print this article
SEARCH DEV SHED

TOOLS YOU CAN USE

advertisement

Once you are inside the directory with all of the source code, begin looking for documentation. Always read the documentation that comes with the source code! If there are any special compile directions, notes, or warnings, they will most likely be mentioned here. You will save yourself a great deal of agony by reading the relevant files first.

So then, what are the relevant files? Typically there are two files in a distribution, README and INSTALL, both of which are located in the root of the source code directory. The README file generally includes a description of the package, references to additional documentation (including the installation documentation), and references to the author of the package. The INSTALL file typically has directions for compiling and installing the package.

These are not, of course, absolutes. Every package has its quirks. The best way to find out is to simply list the directory contents and look for obvious signs of additional documentation. Some packages use different capitalization: readme, README, ReadMe, and so on. Some introduce variations on a theme, such as README.1ST or README.NOW, and so on.

Another common place for additional information is a subdirectory that is appropriately called “doc” or “documentation.”

To view a text file, use the more command:

[root@ford hello-1.3]# more README

To view the text file in the pico editor, use the pico command:

[root@ford hello-1.3]# pico README

TIP  To get a quick list of all the directories in a source tree, enter the command [root@ford hello-1.3]# ls -l | grep drwx.

Configuring and Compiling the Package

Most packages ship with an autoconfiguration script; it is safe to assume they do unless their documentation says otherwise. These scripts are typically named configure, and they take parameters. There are a handful of stock parameters that are available across all configure scripts, but the interesting stuff occurs on a program-by-program basis. Each package will have a handful of features that can be enabled or disabled or that have special values set at compile time, and they must be set up via configure.

To see what configure options come with a package, simply run:

[root@ford hello-1.3]# ./configure --help

Yes, those are two hyphens (--) before the word “help.”

One commonly available option is --prefix. This option allows you to set the base directory where the package gets installed. By default, most packages use /usr/local. Each component in the package will install into the appropriate directory in /usr/local.

With all of the options you want set up, a final run of configure will create a special type of file called a makefile. Makefiles are the foundation of the compilation phase. Generally, if configure fails you will not get a makefile. Make sure that the configure command did indeed complete without any errors.

Compiling Your Package

Compiling your package is the easy part. All you need to do is run make, like so:

[root@ford hello-1.3]# make

The make tool reads all of the makefiles that were created by the configure script. These files tell make which files to compile and the order in which to compile them--which is crucial since there could be hundreds of source files.

Depending on the speed of your system, the available memory, and how busy it is doing other things, the compilation process could take a while to complete, so don’t be surprised.

As make is working, it will display each command it is running and all of the parameters associated with it. This output is usually the invocation of the compiler and all of the parameters passed to the compiler—it’s pretty tedious stuff that even the programmers were inclined to automate!

If the compile goes through smoothly, you won’t see any error messages. Most compiler error messages are very clear and distinct, so don’t worry about possibly missing an error. If you do see an error, don’t panic. Most error messages don’t reflect a problem with the program itself, but usually with the system in some way or another. Typically, these messages are the result of inappropriate file permissions (see the chmod command in Module 6) or files that cannot be found. In the latter case, make sure your path has at the very least the /bin, /sbin, /usr/bin, /usr/sbin, /usr/local/bin, /usr/local/sbin, and /usr/X11R6/bin directories in it. You can see your path by issuing the following command:

[root@ford hello-1.3]# echo $PATH

See Module 6 for information on environment variables so that you can set your path correctly.

In general, slow down and read the error message. Even if the format is a little odd, it may explain what is wrong in plain English, thereby allowing you to quickly fix it. If the error is still confusing, look at the documentation that came with the package to see if there is a mailing list or e-mail address you can contact for help. Most developers are more than happy to provide help, but you need to remember to be nice and to the point. (In other words, don’t start an e-mail with a rant about why their software is terrible.)

This chapter is from Linux Administration, A Beginner's Guide, third edition, by Graham and Shah. (McGraw-Hill/Osborne, 2002, ISBN: 0072225629). Check it out at your favorite bookstore today.

Buy this book now.



 
 
>>> More Site Administration Articles          >>> More By McGraw-Hill/Osborne
 

blog comments powered by Disqus
escort Bursa Bursa escort Antalya eskort
   

SITE ADMINISTRATION ARTICLES

- Coding: Not Just for Developers
- To Support or Not Support IE?
- Administration: Networking OSX and Win 7
- DotNetNuke Gets Social
- Integrating MailChimp with Joomla: Creating ...
- Integrating MailChimp with Joomla: List Mana...
- Integrating MailChimp with Joomla: Building ...
- Integrating MailChimp with Joomla
- More Top WordPress Plugins for Social Media
- Optimizing Security: SSH Public Key Authenti...
- Patches and Rejects in Software Configuratio...
- Configuring a CVS Server
- Managing Code and Teams for Cross-Platform S...
- Software Configuration Management
- Back Up a Joomla Site with Akeeba Backup

Developer Shed Affiliates

 


Dev Shed Tutorial Topics: