Linux Help
guides forums blogs
Home Desktops Distributions ISO Images Logos Newbies Reviews Software Support & Resources Linuxhelp Wiki

Welcome Guest ( Log In | Register )

Advanced DNS Management
New ZoneEdit. New Managment.


Sign Up Now
Reply to this topicStart new topic
> Installing Source Packages .tar.gz .tar.
post Jul 9 2003, 08:42 AM
Post #1

Its GNU/

Group: Admin
Posts: 1,254
Joined: 21-September 02
From: St John's, Newfoundland, Canada
Member No.: 3

The beauty of GNU/Linux and the open source movement is that rather then downloading programs in binary format, which the majority of operating systems do, you can download the source code themselves, compile them and install them yourself.

Source code comes in many forms, the majority of times, you will see it with the common extensions of ".tar.gz" and ".tar.bz2". First off, before you compile a program from it's source code, make sure you have the common utilities for compiling C programs like "Autoconf", "Automake", "Gcc", etc. The majority of distributions should come with this pre-installed, or at the very least, have it easily available on cd. On your specific distribution, you may need to install software packages under the "Kernel Development" or "Development" package headings.


First thing you need to do is extract the source code from it's package. Please follow the appropriate steps depending on the file's extension:

Files with the .tar.gz extension:
[quote]tar zxvf programname-1.0.tar.gz[/quote]

Files with the .tar.bz2 extension:
[quote]bzcat programname-1.0.tar.bz2 | tar xv


tar jxvf programname-1.0.tar.bz2[/quote]

The majority of time, the above commands will extract the source package into it's own directory in the current directory you're working in. Next, compilation.


Enter in the source directory and do a 'ls' to see what files are there. The majority of projects include README and INSTALL files in the base directory of their source tree. Read these with your favorite text editor or pager before moving on. They often describe the steps for compiling the software and what tools are required to compile it. Sometimes these files might be located in a "doc/" directory, so check there first.

When compiling, the first thing you need to do is run the configure script to configure the MAKEFILE's for your system and to make sure you have the nessesary tools to compile the software. configure also has many options that can be passed to it depending on the need and the project. Every configure script that I have ever seen has had the --prefix parameter that can be passed to determine where the package will be installed to. Luckily, you can get a list of what can be passed to it with the following command:

[quote]./configure --help[/quote]

When you are satisfied, you can issue the ./configure command with any parameters you wish (these are optional):

[quote]./configure --prefix=/usr --with-qt-includes=/usr/local/qt/include --with-qt-libs=/usr/local/qt/lib[/quote]

If there were any problems with the configure, such as your system missing a critical package needed to compile the software, configure will immediatly stop and inform you on what's missing. Once again, refer to the INSTALL file and the output of configure to fix the problem and the re-run configure afterwards. Otherwise, some fresh MAKEFILE's should have been created. Makefiles are used by the "make" command to tell it what to compile and how to compile it. From this point, we are ready to compile the software, so, from the base of the source tree, run the command "make".

Depending on the size of the package, this could be quick or it could take a while (kde took me 13 hours to compile on my Athlon XP 1.53 GHz). When "make" completes it's task, you now have a fully functional binary that you can run. The only thing left to do is make it available system-wide so everyone can use it. Now you need to execute the command:

[quote]make -c install[/quote]

This will ask you for your root password so you can get temporary permission to install the package system wide.

Now you should be have the package installed, so you can run it from within your path.

Corey Quilliam
(former) Administrator

Want to help out Check out our Linuxhelp Wiki and see if there are some articles you would like to submit!!

Ubuntu 8.04 64-bit - Work Laptop (HP-Compaq NC6400 Core2)
Kubuntu 8.04 64-bit - Desktop (HP m8120n QuadCore)
Ubuntu 6.04 - Server (I'm not upgrading this baby until support runs out in 2012) (Some old POS dell)
Go to the top of the page
+Quote Post

Reply to this topicStart new topic
1 User(s) are reading this topic (1 Guests and 0 Anonymous Users)
0 Members:


RSS Lo-Fi Version Time is now: 22nd July 2018 - 02:56 PM