Difference between installing from source or binary
Linux - NewbieThis 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
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
Installing from source means you compile the souce code and then install.
Installing from binary means someone allready compiled it into binary and you just have to put it on your computer.
If you are newer linux user, compiling an entire linux os from source is out of the question. You really have to know what you are doing. You first have to build an independent tool chain and then build your system with it.
However, if you already have linux on your computer building a program or two from source is not to difficult. Just download the source instead of the binary package and compile it yourselft.
Building from source gives you more control of course. You can specify gcc flags specific for your computer. Although, the speed advantage of doing this is usually minimal. You can also give the ./configure command specefic details about what support and such you want the finally binary to have. Only good if you know what you are doing otherwise it is a waste of time.
In general source is better because it can be optimized for (for example) an Athlon processor whereas with binaries you're stuck with it being compiled for whatever system the person who compiled it was running...or the lowest common denominator, a 386. Also, if you run a binary and it needs shared libraries, such as GTK, then you have to have the EXACT same version of the libraries on your system as those on the system the binary was compiled on. With source it just usually specifies that you have AT LEAST a specific version - this is often because libraries are not forward compatible (i.e. an older version of the library may not contain functions used by the program that links to that library).
i.e. If you use a library it would request (for example) that you have GTK+-2.4 on your computer. If you use source it would just request that you have at least GTK+-2.0.
The plus side to binary is that they're quicker to install if everything goes right. The downside is that you could have a whole chain of dependencies where one library depends on an exact version of another, which depends on an exact version of another, etc...
I use slackware and compile everything from source, I find it gives fewer headaches!
However, stuff compiled from source will generally not be recognized by your distro's package manager, which may lead to spurious dependency errors down the line. I find that in general it's best to pick one way or the other and stick with it, at least within a related group of packages (e.g. Apache, PHP, and MySQL).
So how does it differ in terms of directory location inside file system?? I mean i noticed that that when i install from binaries, it usually ends up in usr/lib etc. How does one keep track of where they are being installed??
Installing via the pkg mgr means dependencies are satisfied automatically and you can interrogate the pkg mgr for all sorts of info.
With src installs, its down to you to to deal with that and takes some knowledge to do.
If you tells us what distro you're running, we can give better advice, but for an rpm based system eg RHEL, Centos etc, see http://linux.die.net/man/8/rpm http://linux.die.net/man/8/yum
Incidentally, stick to yum for install/updates; rpm doesn't handle dependencies for you.
As above, unless you already know the answer, I'd recommend against installing from src for the reasons given above.
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.