Research Booth Logo ResearchBooth.com

Helping you make informed decisions on important topics.

Content Navigation

  • Home
  • Browse Articles
  • Search All Articles

Site Information

  • About Us
  • Links
  • Feedback
  • License Agreement
  • Privacy Policy

Submit an Article

We are always looking for original content.

If you are a high quality writer then we may have work for you.

Submission Guidelines

What to do with a Source Code Tarball...

When you come to Linux and other open source systems, the countdown begins. No matter how good your package system is, eventually you will need something that is only available in the form of a "tarball", which is jargon for a source code package ending in an extension such as "tar.gz" or "tar.bz2" Unlike an installable package, this object will need to be uncompressed and "compiled", a technical term for "making the source code into an executable binary program".

Wait, don't run away screaming! This is far, far easier than it sounds. You don't need any programming knowledge. It's a matter of typing a few simple commands. The canonical commands you will need are "./configure", "make", and "make install". But first, you're going to have to open that sucker.

With a "tar.gz" file, which is the majority of cases, you can usually type "tar -xzf name-of-file.tar.gz". For "tar.bz2" files it's "tar -xjf name-of-file.tar.bz2". What this means: "tar" stands for "tape archive" and is a program to pack and unpack a bunch of files into one handy, portable glob. It's name comes from the days when backups were made to tape. The "gz" and "bz2" extension is created by the zip compression utilities, which crush the archive into a smaller space so it takes less memory (and is faster to download). The options to tar tell it: -x, extract this file, -z or -j, it's compressed with one of the zip programs so unzip it first, and -f, preserve the folder hierarchy.

Whew, now you have it open! Change directory into the folder and look around. There should be a file called "README" or "INSTALL", by convention; this will be a text file with instructions intended for you mere users. The instructions should be clear, most of the time you can use the package the usual way, but there may be special tweaks you have to do for this package. Lacking the README or INSTALL file, look for a folder called "doc", which will have documentation. If you find no instructions whatsoever, you have a legitimate cause to complain. No matter how busy a programmer is, they should at least be able to include a couple comments as to how to use their program; if not, perhaps their work is so shoddy all around that you would be better off using somebody else's program. Last but not least, try reading the source code files themselves (usually in a directory called "src" and with file extensions ending in ".c", ".h", or ".cpp"), looking for a block of comments at the very beginning of the file. The odd programmer tucks nuggets of wisdom there in the case of very small one-file utilities.

Generally, you start by having the compiler on your system pre-configure the source code, and do so by running a script called "configure". Usually a whole bunch of lines will scroll by with lines like "checking for library file...OK". What it's doing is making sure your system can handle the compile, and setting options so the compiler will know where to find supporting files on your system. If it has a problem, it will stop dead and print "ERROR" with some explanation; if that happens, you're probably over your head by now and will need outside help or a different program.

If the configure script succeeds, you will see a new file called "Makefile". This is the script you run to make the compile happen, and you run it simply by typing "make". Compiler instructions will scroll busily by - it is normal for it to finish up by saying something like "leaving directory so-and-so. Done." If it didn't stop with the word "ERROR" anywhere, give yourself a big hand: you just compiled your first program, you elite hacker, you!

The final step is to be root/sysadmin ID (as you should be for installing any system-wide program) and typing "make install"; this will take the compiled program and dump it into your system with the rest of the binaries, plus it may do extra steps like set up a configuration file in user's home directories or install it's icon in the pixmaps directory. If this, too, exits without an error, you should now be able to run the program! That wasn't hard, was it?

You are now free to delete the tarball and the folders that came out of it; however, you may want to keep it around for backup or to browse the source later if you're interested in learning the programming language. They don't call it open source software for nothing!

Linking to this page is permitted. Copying the content is not.

Home | Feedback | License Agreement | Privacy Policy

Copyright © 2006, ResearchBooth.com | Part of the BlueSparks Network