Administration
  Home arrow Administration arrow Page 4 - Linux Administration: Installing Softw...
Dev Shed Forums 
Administration  
Apache  
BrainDump  
DHTML  
Flash  
Java  
JavaScript  
Multimedia  
MySQL  
Oracle  
Perl  
PHP  
Practices  
Python  
Reviews  
Security  
Style-Sheets  
Web Services  
XML  
Zend  
Zope  
Forums Sitemap 
IBM® developerWorks 
Dedicated Servers 
E-Commerce Hosting 
Linux Web Hosting 
Managed Hosting 
Small Business Hosting 
Download TestComplete 
VPS Hosting 
Weekly Newsletter

 
Developer Updates  
Free Website Content 
 RSS  Articles
 RSS  Forums
 RSS  All Feeds
Write For Us Get Paid 
Request Media Kit
Contact Us 
Site Map 
Privacy Policy 
Support 
 USERNAME
 
 PASSWORD
 
 
  >>> SIGN UP!  
  Lost Password? 
ADMINISTRATION

Linux Administration: Installing Software
By: McGraw-Hill/Osborne
  • Search For More Articles!
  • Disclaimer
  • Author Terms
  • Rating: 4 stars4 stars4 stars4 stars4 stars / 29
    2004-11-02

    Table of Contents:
  • Linux Administration: Installing Software
  • Installing a New Package
  • Uninstalling a Package
  • Compile and Install GNU Software
  • Looking for Documentation
  • Installing the Package and Testing the Software
  • Common Software Problems
  • Cleanup and When There is No Configure Script
  • Compiling and Installing a GNU Program
  • Project Summary

  • Rate this Article: Poor Best 
      ADD THIS ARTICLE TO:
      Del.ici.ous Digg
      Blink Simpy
      Google Spurl
      Y! MyWeb Furl
    Email Me Similar Content When Posted
    Add Developer Shed Article Feed To Your Site
    Email Article To Friend
    Print Version Of Article
    PDF Version Of Article
     
     
     
    ADVERTISEMENT

    Dell PowerEdge Servers

    Linux Administration: Installing Software - Compile and Install GNU Software
    (Page 4 of 10 )

    One of the key benefits of open-source software is that you have the source code in your hands. If the developer chooses to stop working on it, you can continue. If you find a problem, you can fix it. In other words, you are in control of the situation and not at the mercy of a commercial developer you can’t control. But having the source code means you need to be able to compile it, too. Otherwise all you have is a bunch of text files that can’t do much.

    Although almost every piece of software in this book is available as an RPM, we will step through the process of compiling it yourself so that you can pick and choose compile time options, which is something you can’t do with RPMs. Also, an RPM might be compiled for a specific architecture such as the Intel 486. That code might run better if you compiled it natively on your Intel 686 Pentium III class CPU.

    In this section, we will step through the process of compiling the Hello package, a GNU software package that might seem useless at first, but there are reasons for its existence. Most GNU software conforms to a standard method of installing, so let’s go ahead and get the package.

    Getting and Unpacking the Package

    Software that comes in source form is generally made available as a tarball--that is, it is archived into a single large file and then compressed. The tools used to do this are tar and gzip. tar handles the process of combining many files into a single large file, and gzip is responsible for the compression.

    NOTE  Do not confuse gzip with WinZip. They are two different programs that use two different (but comparable) methods of compression. It should be noted, though, that WinZip does know how to handle tarballs.

    Typically, a single directory is selected in which to build and store tarballs. This allows the system administrator to keep the tarball of each package in a safe place in the event he or she needs to pull something out of it later. It also lets all the administrators know which packages are installed on the system in addition to the base system. A good directory for this is /usr/local/src, since software local to a site is generally installed in /usr/local.

    When unpacked, a tarball will generally create a new directory for all of its files. The hello tarball (hello-1.3.tar.gz), for example, creates the subdirectory hello-1.3. Most packages follow this standard. If you find a package that does not follow it, it is a good idea to create a subdirectory with a reasonable name and place all the unpacked source files there. This allows multiple builds to occur at the same time without the risk of the two builds conflicting.

    First, let’s get into the directory we want to compile in:

    [root@ford /root]# cd /usr/local/src

    Download the hello-1.3.tar.gz file from the GNU FTP site at ftp://ftp.gnu.org/gnu/hello/. You can type the URL into a browser and download the package or you can use the ftp command-line tool to download the package

    [root@ford src]# ftp ftp.gnu.org
    Connected to ftp.gnu.org
    220 GNU FTP server ready.
    Name(ftp.gnu.org:root):ftp

    330 Please specify the password.
    Password:sgraham@cs.ucr.edu (You won't see this when you type it)
    ftp>bin
    ftp>hash
    ftp>cd /gnu/hello
    ftp>get hello-1.3.tar.gz
    ftp>bye

    It is a common courtesy to type in your e-mail address as the password. If the ftp account doesn’t work you might want to try anonymous. Once in the ftp command prompt, the bin option tells ftp that you want to transfer the files using binary mode. The hash option will print a hash mark for every 1024 bytes of data sent. Finally, you cd into the directory and then issue the FTP get command to grab the file. You exit the FTP program by typing bye. Then unpack the tarball with the following command:

    [root@ford src]# tar -xvzf hello-1.3.tar.gz

    NOTE  You might encounter files that end with the .tar.bz2 extension. Bzip2 is a compression algorithm that is gaining popularity, and GNU tar does support decompressing it on the command line with the y or j option (instead of the z parameter).

    The z parameter in the tar command invokes gzip to decompress the file before the untar process occurs. The v parameter tells tar to show the name of the file it is untarring as it goes through the process. This way you’ll know the name of the directory where all the sources are being unpacked. You should now have a directory called /usr/local/src/hello-1.3. You can test this by using the cd command to move into it:

    [root@ford src]# cd /usr/local/src/hello-1.3

    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 Administration Articles
    More By McGraw-Hill/Osborne


     

       

    ADMINISTRATION ARTICLES

    - Configuring Load-Balanced Clusters
    - Load-Balanced Clusters
    - UNIX Time Format Demystified
    - Making Changes in the CVS
    - Building Your First CVS Repository
    - CVS Quickstart Guide
    - Authorizing Users in Samba
    - Handling User Accounts in Samba
    - Authentication in Samba
    - Accounts, Authentication, and Authorization
    - Advanced Concepts on Dealing with Files and ...
    - Dealing with Files and Filesystems
    - More Hacks for the User Environment in BSD
    - Personalizing the User Environment in BSD
    - Customizing the User Environment in BSD

     
    Accelerating Trading Partner Performance
     
    Competing on Analytics
     
    Cost Effective Scaling with Virtualization and Coyote Point Systems
     
    Five Checkpoints to Implementing IP Telephony
     
    Hosted Email Security: Staying Ahead of New Threats
     




    © 2003-2008 by Developer Shed. All rights reserved. DS Cluster 6 hosted by Hostway