Advertisement

There's no such thing as a stupid question, but they're the easiest to answer.
Login
Search

Advertisement

Linux and Unix Linux and Unix
Search Search
Search for:
Tech Support Guy > > >

The Techguy Linux Software from source HOWTO


(!)

Whiteskin's Avatar
Senior Member with 1,964 posts.
THREAD STARTER
 
Join Date: Nov 2002
Location: Alberta, Canada
Experience: Windows: Decent. Unix/Linux: Advanced +1
20-Mar-2005, 11:02 PM #1
The Techguy Linux Software from source HOWTO
Techguy Linux-HOWTO: Compile a program from source
($ means as a regular user
# means as root)
The first time one needs to build a program from source, the idea to a new linux user is daunting. But once one has the basics, the procedure becomes quite simple and reptitive.

Almost all program building involves the program 'make'. Make is a special program, which reads input files and performs actions based upon those input files. These files are called Makefiles. One does not, however, need to know how to read nor write these files to build software.

The first thing one does is unpack the archive the source came in.
(Select one based on the extention)
tar xvfz program.tar.gz
tar xvfj program.tar.bz2

Under normal circumstances this will create a folder called program in the current directory. CD into it.

When one builds a program, the simplest of actions is the following:

$ make

Make will then perform the needed action to build the program. After this, you will have your binary in the folder.

Some programs reqire special placing on the drive, and thus need a second command (usually performed as root).
Code:
$ make
# make install
This makes the program, and as root, installs it. Boom, program installed.

More complex programs however, need to know about your system, what is installed, if it's dependencies are satisfied etc.

A third step is now introduced.

Code:
$ ./configure
$ make
# make install
The './configure' tells your shell to execute the script in the current directory called configure. Output will go by, as configure searches for the needed programs and libraries, and outputs the specialized makefiles.

Program installed!

(This howto is very basic. I don't cover more advanced topics like alternate make targets, configure options, automake/gen however it should be good for basics.)
cheese's Avatar
Senior Member with 2,563 posts.
 
Join Date: Jun 2003
Location: Dark Side of The Moon..
Experience: I find computers attractive.
20-Mar-2005, 11:13 PM #2
Sticky for Whiteskin!
mushka's Avatar
mushka mushka is offline
Member with 51 posts.
 
Join Date: Sep 2004
Experience: much to learn
30-Mar-2005, 05:15 PM #3
lmao
I searched for quite a while to find such a wonderfully simple guide to installing from source.

many thanks

chz
ben
mushka's Avatar
mushka mushka is offline
Member with 51 posts.
 
Join Date: Sep 2004
Experience: much to learn
30-Mar-2005, 05:19 PM #4
and cheers to Cheese for making it stick

*BUMP*
CouchMaster's Avatar
Senior Member with 3,298 posts.
 
Join Date: May 2003
Location: West Texas
Experience: n00b
01-Apr-2005, 06:04 PM #5
Straight forward, plain English - Everything should be so easy!
xico's Avatar
Member with 29,787 posts.
 
Join Date: Jun 2002
Location: Venice, FL
Experience: Intermediate
17-May-2005, 04:31 PM #6
Quote:
Originally Posted by Whiteskin
Techguy Linux-HOWTO: Compile a program from source
($ means as a regular user
# means as root)
The first time one needs to build a program from source, the idea to a new linux user is daunting. But once one has the basics, the procedure becomes quite simple and reptitive.

Almost all program building involves the program 'make'. Make is a special program, which reads input files and performs actions based upon those input files. These files are called Makefiles. One does not, however, need to know how to read nor write these files to build software.

The first thing one does is unpack the archive the source came in.
(Select one based on the extention)
tar xvfz program.tar.gz
tar xvfj program.tar.bz2

Under normal circumstances this will create a folder called program in the current directory. CD into it.

When one builds a program, the simplest of actions is the following:

$ make

Make will then perform the needed action to build the program. After this, you will have your binary in the folder.

Some programs reqire special placing on the drive, and thus need a second command (usually performed as root).
Code:
$ make
# make install
This makes the program, and as root, installs it. Boom, program installed.

More complex programs however, need to know about your system, what is installed, if it's dependencies are satisfied etc.

A third step is now introduced.

Code:
$ ./configure
$ make
# make install
The './configure' tells your shell to execute the script in the current directory called configure. Output will go by, as configure searches for the needed programs and libraries, and outputs the specialized makefiles.

Program installed!

(This howto is very basic. I don't cover more advanced topics like alternate make targets, configure options, automake/gen however it should be good for basics.)
Hi Whiteskin,

I'm ready to install Ubuntu. Are there any further instructions, aside from this very good post?
__________________
If any man tells you he loves America, yet hates labor, he is a liar" - Abraham Lincoln
xico's Avatar
Member with 29,787 posts.
 
Join Date: Jun 2002
Location: Venice, FL
Experience: Intermediate
17-May-2005, 04:34 PM #7
Quote:
Originally Posted by Whiteskin
Techguy Linux-HOWTO: Compile a program from source
($ means as a regular user
# means as root)
The first time one needs to build a program from source, the idea to a new linux user is daunting. But once one has the basics, the procedure becomes quite simple and reptitive.

Almost all program building involves the program 'make'. Make is a special program, which reads input files and performs actions based upon those input files. These files are called Makefiles. One does not, however, need to know how to read nor write these files to build software.

The first thing one does is unpack the archive the source came in.
(Select one based on the extention)
tar xvfz program.tar.gz
tar xvfj program.tar.bz2

Under normal circumstances this will create a folder called program in the current directory. CD into it.

When one builds a program, the simplest of actions is the following:

$ make

Make will then perform the needed action to build the program. After this, you will have your binary in the folder.

Some programs reqire special placing on the drive, and thus need a second command (usually performed as root).
Code:
$ make
# make install
This makes the program, and as root, installs it. Boom, program installed.

More complex programs however, need to know about your system, what is installed, if it's dependencies are satisfied etc.

A third step is now introduced.

Code:
$ ./configure
$ make
# make install
The './configure' tells your shell to execute the script in the current directory called configure. Output will go by, as configure searches for the needed programs and libraries, and outputs the specialized makefiles.

Program installed!

(This howto is very basic. I don't cover more advanced topics like alternate make targets, configure options, automake/gen however it should be good for basics.)
Better yet will I be able to install Ubuntu with the information here?
Big-K's Avatar
Member with 6,052 posts.
 
Join Date: Nov 2003
Location: Kansas
Experience: Advanced
17-May-2005, 04:55 PM #8
No. That information is for installing programs. Ubuntu, like most distros, comes with it's own installer(which uses dos-style graphics).
I Fix 4 U's Avatar
Computer Specs
Member with 5,646 posts.
 
Join Date: Jul 2004
Location: Louisiana
Experience: 1+3+3=7
17-May-2005, 04:58 PM #9
Ubuntu is easy enough to install.
Randolf34's Avatar
Randolf34 Randolf34 is offline
Account Disabled with 341 posts.
 
Join Date: Nov 2005
Experience: Beginner
30-Nov-2005, 03:55 AM #10
how about red hat 9.0? having fun with finding iso9660 cd images despite downloads of
everything in sight.
I Fix 4 U's Avatar
Computer Specs
Member with 5,646 posts.
 
Join Date: Jul 2004
Location: Louisiana
Experience: 1+3+3=7
30-Nov-2005, 07:43 AM #11
^Old IMO. Quite old, i'd use fedora if you want redhat, unless you pay.
bearqst's Avatar
bearqst bearqst is offline
Member with 163 posts.
 
Join Date: May 2004
Location: Interior Alaska
Experience: Advanced
30-Nov-2005, 01:50 PM #12
Or WhiteBox for the RHEL4
rob.rice's Avatar
rob.rice rob.rice is offline
Computer Specs
Member with 731 posts.
 
Join Date: Apr 2006
Experience: Advanced
22-Apr-2006, 03:05 AM #13
well one important thing was left out
always always right after untaring the archive read the README file
"$less README "
this is even more important if there is a configure script to run because alot of functionality depends on configuration options and you could miss out on what your installing the program for in the first place
another good idea is to keep the Makefile around just in case you want to uninstall the program a good place to do this is to make a directory named after the program in "/usr/doc" you should also copy the text documentation to this directory including the README file
jarchack's Avatar
jarchack jarchack is offline
Junior Member with 17 posts.
 
Join Date: Apr 2004
21-May-2006, 05:43 AM #14
One thing to be aware of
Many modern distros like ubuntu and red hat have package managers and repositories with prebuilt software. Although many apps can be compiled and installed (assuming dependencies are fulfilled) you may end up hosing your distros package manager database. eg, you can download, extract, compile and install the latest version of software-x.xx but when you go to use apt or synaptic afterwords it will tell you that there's a broken package. With ubuntu being Debian based I don't thing there's a single application that hasn't already been made into a .deb file.
klam's Avatar
klam klam is offline
Senior Member with 147 posts.
 
Join Date: Apr 2006
Experience: Advanced
16-Jun-2006, 07:39 PM #15
Pretty nice mini-tuto so simple and so clean. Now my question is... how do you go about uninstalling the program since *nix don't have the add/remove programs? (assuming the program installed doesn't have an uninstall option)

Don't tell me it's like Mac that u just drag the whole folder to the recycle bin lol
As Seen On

BBC, Reader's Digest, PC Magazine, Today Show, Money Magazine
WELCOME TO TECH SUPPORT GUY!

Are you looking for the solution to your computer problem? Join our site today to ask your question. This site is completely free -- paid for by advertisers and donations.

If you're not already familiar with forums, watch our Welcome Guide to get started.


(clock)
THIS THREAD HAS EXPIRED.
Are you having the same problem? We have volunteers ready to answer your question, but first you'll have to join for free. Need help getting started? Check out our Welcome Guide.

Search Tech Support Guy

Find the solution to your
computer problem!




Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools


WELCOME
You Are Using: Server ID
Trusted Website Back to the Top ↑