Installing Source Packages .tar.gz .tar.
The DNS Guys
25 Nameservers Worldwide
Host Monitoring & Auto Rollback
Smart Relay, SASL
OpenID Servers & XMPP
TSIG & Secondary DNS
Amazon Route53 GUI
Installing Source Packages .tar.gz .tar.
Jul 9 2003, 08:42 AM
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:
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.
(former) Linuxhelp.ca Administrator
Want to help out Linuxhelp.net? 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)
|Lo-Fi Version||Time is now: 21st May 2013 - 09:44 PM|