Latest LQ Deal: Latest LQ Deals
Go Back > Forums > Linux Forums > Linux - General
User Name
Linux - General This Linux forum is for general Linux questions and discussion.
If it is Linux Related and doesn't seem to fit in any other forum then this is the place.


Closed Thread
  Search this Thread
Old 02-12-2003, 12:05 PM   #1
LQ Guru
Registered: Jan 2001
Posts: 24,149

Rep: Reputation: 266Reputation: 266Reputation: 266
Useful thread and information about installing programs.

How to install from source

Basically this short how-to will explain how to install those tar.gz and .tgz type files. It will cover the basic
commands and steps to get you to install a program from source with no problems, or at least get you in the right

So we'll take an example download program, gaim for example since its popular and commonly asked on this site on
how to install from source.

After you download gaim which I believe the latest stable version is gaim-0.59.8.tar.gz, most of the time it will
download to your home directory by default unless you specify elsewhere.
The first thing we want to do is cd into the directory where we've downloaded it.

$ cd ~
The command above will change you automatically to your current users home directory. There you should find your
newly downloaded gaim-0.59.8.tar.gz. The next step/command involves the extraction of the files that are tarballed.

$ tar xvf gaim-0.59.8.tar.gz
This should extract the files into a new directory usually named the same as the file without the tar.gz at the end.
In this case this would create a directory named ~/gaim-0.59.8
At times you will also need to use the z flag if the file is compressed thru gzip, most of the time you will know
cause it will spit an error out saying that it is compressed, etc. To run this option you would use something like

$ tar xzvf gaim-0.59.8.tar.gz
However if you ever wanted to extract to another directory you've created, name it something else besides the default name
or an existing directory you can run a command like this:

$ tar xvf gaim-0.59.8.tar.gz -C new-directory
Now that you have it extracted, you will then need to cd into the new directory where all the files are located.

$ cd gaim-0.59.8
From this point we need to configure and compile the program now. Take note the following steps are the basic way
to install from source, some programs might differ as most will always be tarballed with a INSTALL, README or both files.
It is always a good idea to read these files to find specific instructions on how to install any particular program.

Follow these steps to install the program from a command or terminal after cd'ing into the directory you just
extracted the program to:

$ ./configure
This will basically check for required components on your system, better known as dependencies and also build your
make file.
If you don't get any errors then you will want to go to the next step to make.

$ make
Now from this point after make we'll want to perform the make install as root. This is usually done as root as it will
need access to particular parts of your system where a regular user has no rights to write to.

$ su -m
$ [root password prompt]
$ make install
$ exit
Basically that su -m will prompt you for the root password but after logging in, with the -m flag it will keep you in the
existing directory you were working from instead of placing you in root's home directory. The exit command will log you
out of being root.

Now its optional but to clean up any temp files that were created you can do this:

$ make clean
And that should pretty much be it on installing from source files. For more information and documentation you can
always resort to the man pages.

Hope this helps any newcomers to Linux as to any others that want to install from a tarball source file.

Last edited by trickykid; 07-10-2005 at 09:18 AM.
Click here to see the post LQ members have rated as the most helpful post in this thread.
Old 05-20-2003, 04:39 PM   #2
LQ Guru
Registered: Jan 2001
Posts: 24,149

Original Poster
Rep: Reputation: 266Reputation: 266Reputation: 266

Contributed by mhearn

Compiling from source is something that will always work, given enough
time and patience. Things become a lot easier however when there is a
package available for your distro. Red Hat, SuSE and Mandrake all use
RPM packages, and it is vital that you only use RPMs designed for your
distro, and usually, for the exact version of your distro.

Other RPMs may work, but also they may not. RPMs are normally clearly
labelled as to which distro they are meant for in their file names
(unless they are specifically designed to install on any), for example:

.. is probably meant for Red Hat 8. Another common abbreviation is mdk
for Mandrake.

RPMs meant for older versions of a distro can sometimes be installed on
newer ones, but rarely, if ever, the other way around. For instance, a
package meant for Mandrake 8.1 will probably install OK on 8.2, but a
package meant for Mandrake 9 will not run on 8.1.

To install an RPM, you must first download it and then, as root, run
this command:

rpm -Uvh something-2.4-rh8.rpm
Obviously replacing the made up name with the file you downloaded.
Remember to use tab completion to save typing!

Sometimes RPM may refuse to install a package. Errors about missing or
failed dependencies mean you need to find, download and install those
packages first. But be careful! Not all packages can be installed from
the net. In particular:

* Failed dependencies that mention GLIBC are probably an indication that
you downloaded an RPM meant for another distro, or a newer version of
your own distro. If there is no RPM available, use the source tarball
(tar.gz file). You cannot upgrade glibc, but you'll find that using an
RPM built for your distro, or compiling from source, will magically fix
this dependency.

* There are some packages that you almost certainly have on your
distribution CDs, but might not be installed depending on what options
you chose when you first installed Linux itself. Examples of such
packages would be gcc, GTK, glib, Qt, anything related to KDE or GNOME
and so on. When you need to resolve a dependency (install a package the
one you want needs), check the CDs first to see if they are available on
there. For Redhat users, you can use the "Add/Remove Packages tool" and
have a hunt under the options. Mandrake users might want to try urpmi.

* A file ending in .src.rpm is a different thing entirely, you probably
want to avoid these for now.

* If two packages appear to depend on each other, this is called a
circular dependency and can be fixed by specifying them all on the same
command line to RPM, for instance:

rpm -Uvh foo.rpm bar.rpm
If you're thinking this is a lot of hassle, you're right. An easier way
is to use a program that will automatically download and install (or
upgrade) the software you ask for, as well as anything it needs. For
Redhat users, you want to get apt - Mandrake users already have such a
thing included, called urpmi.

To install apt, get the RPM from
( and then run as root:

apt-get update && apt-get install synaptic
which will install the Synaptic GUI. You can then use it to pick the
software you want from a list and the package, and any dependencies,
will be automatically installed. A word of caution - not all software is
available via apt, so you'll still need to know how to compile from
source, and install RPMs by hand.

Sometimes RPM might freeze. If you run rpm from the command line, and it
doesn't do anything for say 30 seconds, RPM probably broke. To fix it,
make sure nothing is running that might be using it (for instance, shut
down synaptic or the add/remove packages window) and run these commands
as root:

cd /var/lib/rpm
rm __db.*
Finally, if you aren't sure about anything, you can always ask!
Installing software can be one of the most confusing and convoluted
aspects of using Linux, expect improvements to it in the next few years.
For now, just remember that if a program is being especially obstinate
about installing,, and the source tarballs are
your friends.

- thanks mhearn

Last edited by trickykid; 05-20-2003 at 04:41 PM.
25 members found this post helpful.

Closed Thread

Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Similar Threads
Thread Thread Starter Forum Replies Last Post
Information about building a network server and the right programs Blackharaz Linux - General 3 04-29-2005 02:14 PM
thread-hijacking / installing apollon Matt Barnes Linux - Newbie 4 12-06-2004 07:59 PM
re : News: Useful thread and information about installing programs. AcerKev Linux - General 0 07-06-2004 02:55 PM
How to get timing information for a thread vtluu Red Hat 2 04-20-2004 05:18 AM
Useful thread and information about UNINSTALLING programs. BeFalou Linux - General 2 02-13-2003 05:41 PM > Forums > Linux Forums > Linux - General

All times are GMT -5. The time now is 11:53 AM.

Main Menu
Write for LQ is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration