LinuxQuestions.org
Share your knowledge at the LQ Wiki.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Software
User Name
Password
Linux - Software This forum is for Software issues.
Having a problem installing a new program? Want to know which application is best for the job? Post your question in this forum.

Notices


Reply
  Search this Thread
Old 01-27-2011, 09:28 PM   #1
gardenair
Member
 
Registered: Oct 2004
Location: LH
Posts: 610

Rep: Reputation: 31
How to complete and install sourse code files.


Hi
I have no preior experience about to installation procedure in linux.currently i am using red hat linux which normally support rpm.
I have to download a software from net which have extention like blablabla.tar.gz or blablabla.bz2.Normally most softwares can be complied in installed in three simple steps

./configure
Make command
Make install

I have not use these commands i just have a bit knowledge about it which i have mentioned here.

Kinly guide me how to extract sourse code fine and then compile and at last installed in the pc.
Thanks a lot for the help.
garden
 
Old 01-28-2011, 12:38 AM   #2
Oliv'
Senior Member
 
Registered: Jan 2004
Location: Montpellier (France)
Distribution: Gentoo
Posts: 1,014

Rep: Reputation: 36
Hello,

So I assume that your package is downloaded, and that you have already installed all the necessary tool for compilation (for example many distributions do not have a compiler installed by default).
First step: package extraction.
Code:
tar xf mypackage.tar.gz -C /path/where/you/want/to/extract/sources/
Second step: configuration
Code:
cd  /path/where/you/want/to/extract/sources/
./configure
a good advice would be to first do a "./configure --help" to check available config option for your package.
Third step: compilation
Code:
make
Final step: install
Code:
sudo make install
Regards,

Oliv'
 
1 members found this post helpful.
Old 01-28-2011, 12:46 AM   #3
prodev05
Member
 
Registered: Jul 2009
Location: Planet Earth
Distribution: Unix & Linux Variants
Posts: 304

Rep: Reputation: 20
Follow the instructions given in the README/readme file from the installation bundle.
 
0 members found this post helpful.
Old 01-28-2011, 12:46 AM   #4
GlennsPref
Senior Member
 
Registered: Apr 2004
Location: Brisbane, Australia
Distribution: pclinuxos slackware64 tails kali
Posts: 3,382
Blog Entries: 33

Rep: Reputation: 217Reputation: 217Reputation: 217
Hi, yes those look like the right commands, but you'll need to unpack the tar.gz (gzip) first.

cd to the directory where the file filename.tar.gz is located.

use tar to unpack with the gzip (z) (bzip uses xjf),

Code:
tar xzf filename.tar.gz
Code:
cd
to the new folder, If you don't type on in it will be created, type
Code:
ls
to check it exists.

Now you should be ready to configure and make the package.

with the commands similar to the above.

Code:
./configure
Code:
make
and as root su, or sudo (you may not need this, for some systems) you need admin to write a file to /usr/bin on most systems.
Code:
make install
Read the readme carefully, to see if there are any more instructions/directions.

The make install usually copies the compiled files to their proper directory.

doc files to the /usr/share/doc dir,
the executable to /usr/bin, help to help, etc...

You could make these links/shortcuts.

Cheers Glenn

Hope this helps.

Last edited by GlennsPref; 01-28-2011 at 12:47 AM. Reason: beaten to the post, this amy be irrelevant.
 
1 members found this post helpful.
Old 01-28-2011, 11:20 AM   #5
gardenair
Member
 
Registered: Oct 2004
Location: LH
Posts: 610

Original Poster
Rep: Reputation: 31
thanks for reply well there is still a little bit confusion
What does the following do
./configure
make
make install
Make install put the things in its proper location which is clear.
 
Old 01-28-2011, 06:10 PM   #6
GlennsPref
Senior Member
 
Registered: Apr 2004
Location: Brisbane, Australia
Distribution: pclinuxos slackware64 tails kali
Posts: 3,382
Blog Entries: 33

Rep: Reputation: 217Reputation: 217Reputation: 217
OK, the configure script sets up the Makefile.

It does this by looking for,
build libs are installed, what versions and catalogues which ones are available at build time.

make
checks dependant packages are installed.

and compiles the executable, docs and help/man page

It's done this way to save having to edit the source, we may control the build from the Makefile.

Imagine you have a package that will work on M$Win, Mac and GNU/Linux...

The configure script and Makefile contains the appropriate places and names to search prior to compilation.

So it's (an) installer, find the correct versions of the libs required, if not found, output an error and tell the user what is missing.

(it's not failsafe, but generally you won't be able to compile a program if you don't have the deps and libs required)
Glenn

Last edited by GlennsPref; 01-28-2011 at 06:12 PM.
 
Old 01-29-2011, 08:48 AM   #7
gardenair
Member
 
Registered: Oct 2004
Location: LH
Posts: 610

Original Poster
Rep: Reputation: 31
I want to ask "GlennsPref" as you give an example

Code:
tar xzf filename.tar.gz
This command extract the file

then you use
Code:
 cd
The cd command will will change the directory

Code:
ls
the ls command will list the files & directories in the current directory.

The nest you mention[CODE]
./configure[/CODE

and you had mentioned "with the commands similar to the above."

this thing is not clear.

The last thing which I want to clear.
I have extracted a directory and see the files in it as

Code:
configure
configure.in
Makefile.am
Makefile.in
please guide me which one should I choose ?
 
Old 01-29-2011, 08:57 AM   #8
Hangdog42
LQ Veteran
 
Registered: Feb 2003
Location: Maryland
Distribution: Slackware
Posts: 7,803
Blog Entries: 1

Rep: Reputation: 417Reputation: 417Reputation: 417Reputation: 417Reputation: 417
Since you're new to compiling, I would HIGHLY recommend src2pkg which can create a package for a variety of distros from source code. It started out as a Slackware tool, but has since developed to be able to create any of the most commonly used package types. The benefit to doing it this way is that you can handle the compiled code as you would any other package, so it makes management MUCH easier. As a side benefit the developer, gnashley, is an active member here at LQ.
 
Old 01-29-2011, 09:34 AM   #9
lazlow
Senior Member
 
Registered: Jan 2006
Posts: 4,363

Rep: Reputation: 172Reputation: 172
The first thing you want to try on any RH based system is to make sure no repo already has the package avialable. Not all packages will be, but the vast majority are. IF you would tell us what distro, version, and arch you are running it will save a lot of time(Centos5.5 64bit in my case). Make sure to specify weather you are run RH(old unsupported series that should not be run) or RHEL(current). Also tell us what package you are trying to install and we may be able to point you to a repo that has it.
 
Old 01-29-2011, 11:28 AM   #10
gardenair
Member
 
Registered: Oct 2004
Location: LH
Posts: 610

Original Poster
Rep: Reputation: 31
well it is red hat 9.Though it is old version but according to my system (Ram and processor) it work fine.I want to use squid 2.6 on it which is available on binary format.
 
Old 01-29-2011, 12:04 PM   #11
lazlow
Senior Member
 
Registered: Jan 2006
Posts: 4,363

Rep: Reputation: 172Reputation: 172
RH9 hit EOL(End of Life) in 2003(?) there have been no offical updates of any kind for it since that time. To give you some idea how far behind it is, Fedora was the RH backed platform that followed the RH line, Fedora15 is due to be released in April(?). Even on the RHEL(Red Hat Enterprise Linux) side they are on RHEL6.0. Centos is the free (to install and update) branch of RHEL.

Squid 2.6 is current on Centos/RHEL5.5. It is highly UNlikely that the Glibc that RH9 is built on will be able to handle squid2.6.

Last edited by lazlow; 01-29-2011 at 12:19 PM.
 
Old 01-29-2011, 12:50 PM   #12
Hangdog42
LQ Veteran
 
Registered: Feb 2003
Location: Maryland
Distribution: Slackware
Posts: 7,803
Blog Entries: 1

Rep: Reputation: 417Reputation: 417Reputation: 417Reputation: 417Reputation: 417
Quote:
well it is red hat 9.
You want to find a new distro, now. Particularly since your plans seems to involve allowing this machine to touch the internet. RH9 has tons of security holes, and they will not be patched. Ever. There are lots of good distros to choose from, some of which are aimed at older hardware, so if you can give us some specs, we can point you in a more appropriate direction.
 
Old 01-29-2011, 12:52 PM   #13
gardenair
Member
 
Registered: Oct 2004
Location: LH
Posts: 610

Original Poster
Rep: Reputation: 31
Well the thing which i want does not depend what version of red hat i am using.tar command is even use in unix and if i say about red hat 7 even in it.
Yes u r correct that the version is too much old but i am doing it on test bases.
 
Old 01-29-2011, 05:59 PM   #14
GlennsPref
Senior Member
 
Registered: Apr 2004
Location: Brisbane, Australia
Distribution: pclinuxos slackware64 tails kali
Posts: 3,382
Blog Entries: 33

Rep: Reputation: 217Reputation: 217Reputation: 217
Quote:
and you had mentioned "with the commands similar to the above."
I only meant to correct the case, make not Make,
and sometimes configure will work without the ./ (prefix)

Quote:
The last thing which I want to clear.
I have extracted a directory and see the files in it as
the make program will find the files it needs, as long as you are in the correct directory.

I have not read the above posts yet, sorry if this is covered above.

Regards Glenn
 
1 members found this post helpful.
  


Reply


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 Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
writing complete code block in a terminal drmjh LQ Suggestions & Feedback 6 01-04-2011 02:35 PM
Image won't show - JAVA, complete code Nimoy Programming 5 11-01-2007 11:10 AM
error in compiling sourse rpm... vikas04522 Fedora 1 09-02-2006 08:18 AM
complete source code. bruse Linux - Newbie 3 08-29-2005 06:10 PM
What to do to install Linux from Sourse 'HARDDISK' sureshsaragadam Linux - Newbie 12 09-17-2003 04:47 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Software

All times are GMT -5. The time now is 06:58 PM.

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