LinuxQuestions.org
Review your favorite Linux distribution.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!

Notices


Reply
  Search this Thread
Old 02-03-2008, 03:23 AM   #1
Paris Heng
Member
 
Registered: Jul 2007
Location: Kuala Lumpur, Malaysia
Distribution: Ubuntu 8.04, Solaris 10
Posts: 198

Rep: Reputation: 30
Source and Binary in Linux


Dear,

I use Linux for half and a year. What actually is Source and Binary in Linux on regards to installation?

I know archiver and compression format example like, tar.gz.

File format package like .deb and rpm.

What is source and binary actually? It is the content in the file format and etc? Please somebody give me information.

Thanx
 
Old 02-03-2008, 03:24 AM   #2
AceofSpades19
Senior Member
 
Registered: Feb 2007
Location: Chilliwack,BC.Canada
Distribution: Slackware64 -current
Posts: 2,079

Rep: Reputation: 58
source is usually .tar.gz and binary is .deb and .rpm. Source is the source code for the application and usually requires compiling the source code to install and binary packages get installed through the package manager and don't require compiling
 
Old 02-03-2008, 03:35 AM   #3
lazlow
Senior Member
 
Registered: Jan 2006
Posts: 4,363

Rep: Reputation: 172Reputation: 172
Source needs to be compiled to run. Binaries are already compiled.

In rpms there are actually two types (binary and source). Source rpms usually have a src in the name. So a binary rpm is a source rpm that has already been compiled.
 
Old 02-03-2008, 03:36 AM   #4
bitpicker
Member
 
Registered: Jul 2003
Location: Germany
Distribution: Xubuntu, Ubuntu
Posts: 416
Blog Entries: 14

Rep: Reputation: 35
Packages like RPM and DEB are formats for distributing software for a given distribution. They usually are binary (someone has precompiled them for the distribution specifically so they might not work in other distributions), but there are sourcecode packages as well. These don't compile, they are there for people wanting sourcecode access. They often have SRC in their name, too.

The advantage of precompiled binaries is that they install more quickly, and they should work in your system if they are intended for the distribution. The drawback of precompiled binaries is that someone else has decided which options to compile into the binary and which to leave out, if any, so your binary might include options you don't need or lack ones which you do.

Source code enables you to compile the software specifically for your system, but you will usually have to solve dependencies (libraries etc. the software expects to be on your system) by yourself. Compilation takes more time than installing binaries. You get to choose your options yourself, but that also means that you have to do so.

Most distributions use a binary format for ease of use, but the fact that a given version of a distribution has certain common presets (uses a specific compiler, a specific set of libraries etc.) means that after a while no new packages for the distribution are released. Newer programs might need newer libraries, and the basis for the distribution in question cannot be changed without breaking binary compatibility. That's why you need to upgrade such distributions regularly if you want access to newer software.

Distributions like Gentoo, which compile software from source, don't need such upgrades, they go with the flow and always remain current if you update your software regularly. For instance, I installed my Gentoo in January 2006 but today I'm on a 2.6.23 kernel and using all the latest software without ever having done a system-wide upgrade or reinstallation. The price is a day of compiling updated software versions every now and then...

Robin
 
Old 02-03-2008, 03:51 AM   #5
lazlow
Senior Member
 
Registered: Jan 2006
Posts: 4,363

Rep: Reputation: 172Reputation: 172
Bitpicker

You can compile src.rpms. Here is an old howto but it gives you the idea:

http://www.redhat.com/archives/rpm-l.../msg00030.html
 
Old 02-03-2008, 04:12 AM   #6
Paris Heng
Member
 
Registered: Jul 2007
Location: Kuala Lumpur, Malaysia
Distribution: Ubuntu 8.04, Solaris 10
Posts: 198

Original Poster
Rep: Reputation: 30
Thank for you information.

I here still got one question on the definition of "compile".

For myself, which concept is correct?

(1) Compile source -- mean compile the file FILENAME.tar.gz to a folder FILENAME ? or

(2) Compile source -- mean translate the source code (text code) into another computer language code (object code/machine code)?

--Which one is correct on regards to the definition "compile source".

--How about the command in "make, make install"? It is a command

--How about the command ./configure ?

Can explain? Thousand thank.

Last edited by Paris Heng; 02-03-2008 at 04:14 AM.
 
Old 02-03-2008, 04:22 AM   #7
lazlow
Senior Member
 
Registered: Jan 2006
Posts: 4,363

Rep: Reputation: 172Reputation: 172
#2 is closer.

First you use "./configure" to tell the compiler what you have (that it can use) and where it is located. Then you "make" it (actual compile). Finally you "make install", which puts the compiled binary where your system needs it to be in order for you to use it.
 
Old 02-03-2008, 04:52 AM   #8
Paris Heng
Member
 
Registered: Jul 2007
Location: Kuala Lumpur, Malaysia
Distribution: Ubuntu 8.04, Solaris 10
Posts: 198

Original Poster
Rep: Reputation: 30
Thank for the information. I now understand.
 
Old 02-03-2008, 08:35 AM   #9
Paris Heng
Member
 
Registered: Jul 2007
Location: Kuala Lumpur, Malaysia
Distribution: Ubuntu 8.04, Solaris 10
Posts: 198

Original Poster
Rep: Reputation: 30
Dear again,

One more question, let say i install a program (program named "combat") in /etc/combat/.

When I start the 'make install' command, where the file being install? Can I trace where it going to install by searching in the INSTALL file? How can I trace all the installation file?

Thanx.
 
Old 02-03-2008, 12:39 PM   #10
lazlow
Senior Member
 
Registered: Jan 2006
Posts: 4,363

Rep: Reputation: 172Reputation: 172
Paris

First you are thinking in windows and trying to run Linux(this will only give you a headaches). You have to start thinking in Linux. It is a little like learning to speak a foreign language.

In Linux you do not install a program to a particular directory, Linux decides where it should be stored and puts it there (make install). This is done in order for things to be consistent across multiple machines/distros. Now you do choose where you want to compile the software (usually in the users /home space). After linux installs the software it is available from the command line (it is in your path). So if I make install a program named "fred", I can type "fred" from the command line and run the program(you do not need to know where fred is stored). On the other hand if you go to make an icon for fred, life is much better behaved if you know where fred is stored. In this case you can "locate fred", "whereis fred", or "which fred" (each tool is slightly different but 90% of the time they will be interchangeable) to find out where the file is located (usually /usr/bin/).


Now is the ugly part "How can I trace all the installation file?" and this is why using your package manager is vastly superior to compiling on your own. When you "make install" a program there are addition files that are generated along with the binary (config files,etc). Now if you are lucky the person who built your application built a make uninstall file. If that person did make a uninstall file and you want to remove the application it is no big deal, you just "make uninstall" in the same directory that you "make install"ed from, and everything should be removed. Now if they did not make a "make uninstall" file or they made a poor one, life can be difficult. You can just remove the binary and ignore any other associated files (usually the safest thing to do) or you can try and track down all the associated files(which can be a real chore). This is why the package managers are so superior. (using rpms and yum as an example) You just "yum remove application" and the application is removed along with most of the associated files. I say most because (just like make uninstall) the person who built the package may or may not have done things properly (so that everything gets removed). However most reputable repositories have been building packages long enough that they (generally) do not make these kinds of mistakes.
 
Old 02-03-2008, 10:46 PM   #11
Paris Heng
Member
 
Registered: Jul 2007
Location: Kuala Lumpur, Malaysia
Distribution: Ubuntu 8.04, Solaris 10
Posts: 198

Original Poster
Rep: Reputation: 30
Thank you, I understand now. Because most of the time i install through Synaptic Package Manager(in Ubuntu), as well as in SuSE. When I come along with source file, i don't know what to un-install once i make file. Thank alot.
 
  


Reply



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
Want people for a new source/binary linux distro genix Programming 2 09-17-2007 10:00 PM
Source or Binary? dick_onion53 Fedora 4 12-31-2004 06:04 PM
Source or binary? NonSumPisces Linux - Distributions 2 06-06-2004 03:01 PM
Source vs. Binary? rhraz Linux - Newbie 4 03-03-2004 04:16 PM
I want Linux source code for FAT file system in user readable form not in binary form ramya272 Linux - Newbie 5 02-05-2004 07:54 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie

All times are GMT -5. The time now is 07:25 AM.

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
Open Source Consulting | Domain Registration