Results 1 to 6 of 6

Thread: Installing Linux Software From Source

  1. #1
    Senior Member
    Join Date
    Oct 2001
    Posts
    677

    Exclamation Installing Linux Software From Source

    Installing From Source In Linux

    I am aware that 99% of people who use linux and visit AntiOnline are probably more than capable of doing this, but I've seen several people in IRC lately who had trouble installing software from a source download.

    The method shown below should cover generic installs for all eventualitues (except RPM packages).

    For the example, I shall use "nmap-3.00.tar.gz"

    1. Find the file type, and decompress
    This is more useful than it sounds. For example, you download a .tar.gz file in Mozilla, and Mozilla decompresses it on-the-fly, but saves it with the .gz extension still there - it is now only a tar file, but the file extension suggests you need to run gunzip, or the tar -z option... Running this will tell you more about the file you're trying to install:

    file nmap-3.00.tar.gz

    The output will tell you that the file is either "gzip compressed file" or "tar archive".
    If the file is "gzip compressed", run the following:

    gunzip nmap-3.00.tar.gz

    This will leave you with a file called nmap-3.00.tar
    You can now untar the file,
    tar xvf nmap-3.00.tar

    If the file has a .bz2 extension, or shows "bzip compressed file" as the output of the file command, you should run:
    bunzip2 file.tar.bz2
    tar xvf file.tar

    2. Configure
    Now execute the following:
    cd ./nmap-3.00
    (of course, use the directory created from the extraction of the files from the tar archive)
    ./configure
    (configure scripts can often take paramaters, although usually don't need to unless you are installing software in conjunction with other software (e.g. Apache and PHP) or if your system has required libraries in a different place to usual, you can tell configure where to find them. type ./configure --help to list the options you can pass to the script)

    3. Compiling & Installing
    If configure ran successfully, i.e. did not exit with an error message, you can now run the following:
    make &&
    make install
    (the && after make prevents 'make install' running unless make successfully completed).

    4. Optional Steps
    You can now optionally type:
    make clean
    to clear up a few files and perhaps save a bit of disk space, although this isn't usually a problem for most people living in modern times with computers having excessively large hard drives
    One Ring to rule them all, One Ring to find them.
    One Ring to bring them all and in the darkness bind them.
    (The Lord Of The Rings)
    http://www.bytekill.net

  2. #2
    Senior Member problemchild's Avatar
    Join Date
    Jul 2002
    Posts
    551
    I was actually thinking about doing this same tutorial, but you beat me to it. I'll just throw in one little bit.....

    Most packages will compile fine with the above procedure, but every once in a while you'll run across an oddball. After you untar the file, there is almost always a file called either INSTALL or README (or both). If you have trouble compiling something, read these files carefully and they will tell you if the package has any dependencies or if there are any special compiling instructions.
    Do what you want with the girl, but leave me alone!

  3. #3
    Senior Member
    Join Date
    Oct 2001
    Posts
    677
    Thats true.
    Specifically, things like Apache, PHP, PostgreSQL, need additional options to compile with support for each other (I already wrote tutorials on installing all 3 of those). Another thing to note is that the MySQL downloads are typically *binary* .tar.gz files, so you simply need to unpack and read the README file to find out what to do next.
    General rule: If all else fails, read the docs!
    One Ring to rule them all, One Ring to find them.
    One Ring to bring them all and in the darkness bind them.
    (The Lord Of The Rings)
    http://www.bytekill.net

  4. #4
    that's a good starting point. the next thing to cover would be environment variables and libraries in conjunction with installing progs from source.

  5. #5
    Senior Member
    Join Date
    Oct 2001
    Posts
    677
    I'll work on that one if I get time.
    One Ring to rule them all, One Ring to find them.
    One Ring to bring them all and in the darkness bind them.
    (The Lord Of The Rings)
    http://www.bytekill.net

  6. #6
    BIOS Bomber
    Join Date
    Jul 2003
    Location
    Michigan
    Posts
    357
    This may be old but it is one of the best written tutorials I have seen here. it rocks man. its simple, easy, and gets to the point.
    "When in doubt, use Brute Force."

    Never argue with an idiot. They'll drag you down to their level, then beat you with experience.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •