LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Newbie (https://www.linuxquestions.org/questions/linux-newbie-8/)
-   -   Difference between installing from source and binaries? (https://www.linuxquestions.org/questions/linux-newbie-8/difference-between-installing-from-source-and-binaries-391272/)

Infernal211283 12-10-2005 10:29 AM

Difference between installing from source and binaries?
 
Hi,

Is there a difference between installing from binaries and compiling from source?

If i remove a binary package with rpm -e <package>
how do i remove a program which i compiled from source?

Nylex 12-10-2005 10:39 AM

The main thing with installing from source is (I think) that the software will be optimised for your machine.

In general, there's no easy way to uninstall a package you installed from source. Some let you do a "make uninstall", but if the particular package you want to uninstall doesn't have that then I think you have to go and delete every file and folder that was created during the installation.

HTH

Infernal211283 12-10-2005 10:42 AM

and if i did that, where would i look for those installed files i should erase?
is there a list of installed files or a default directory for source installations?

Infernal211283 12-10-2005 10:43 AM

i use fedora core 4 btw, forgot to mention :)

jollyjoice 12-10-2005 10:48 AM

Source tends to take longer to actually do but is often better for your machine in the end, if your gonna use source is best to get a source based distro, like gentoo.

ninjabob7 12-10-2005 10:58 AM

A binary (.rpm and .deb) contains the executables and libraries for the program, as well as a list of dependencies. When you install an rpm or deb package, it checks to see whether other programs or libraries it needs are installed, then installs itself to the proper place. Rpms (Redhat package manager) are used on RedHat, Fedora, Mandrake/Mandriva, and some others. Debs (Debian packages) are used on Debian, Ubuntu, and other Debian-based distros. A source archive (.tar.gz, .tar.bz2, .tgz, .tbz) contains the source code (usually C or C++) for the program. To install it, you extract the archive (unzip in Windows terms), cd to the directory, and run several commands. Usually, the first command is ./configure with some options at the end. This sets up the program with the options you want. Then, run make. This does the actual work of compiling the source code. Finally, the last command is usually make install, which puts the proper files in the proper directories. Source archives can be used on any distro that has gcc, make, and some other stuff installed. In some distributions, such as LFS, they are the only way to install software. The advantages of binaries are: easy to find, easy to install, easy to uninstall, and automatically check dependencies. Which format you use depends on which distro you use, although there is a program called alien that converts between several different formats. The disadvantages are: not easy to configure, not easy to patch, and don't work on every distro. The advantages of source archives are: will work on any distribution, can be configured to install only certain parts or whatever, can be patched, and more programs are available as source archives. The disadvantages are: harder to install for newbies, and don't check dependencies. Basically, if you're a newbie, you should use binaries. They're just easier. However, not every program has binary versions, and not every program can be found in the list in a package manager. You should definetely learn how to use source archives, because like I said, not every program has binaries. Source archives are better if you need to customize. I don't know how to uninstall a source program, or even if you can. I would assume it's something like make uninstall in the source directory, but that's just a guess. Somebody correct me if I'm wrong on that.

PS: Hehehe, you just got about 5 more replies while I was writing this. I hope I didn't repeat anything that's already been said.

Infernal211283 12-10-2005 11:16 AM

yeah i guess i'm still a newbie, don't want to be one for long though, ;)

are there any known howtos for source newbies?

Infernal211283 12-10-2005 04:09 PM

Thank you all :)

Milosevic 12-10-2005 04:25 PM

ninja, i totally disagree with you when you say source is harder than binary. When you got a software source code, there are basically three steps to follow in order to get the damn program working. First, run the configure script (basically, a shell script whose goal is to create the makefile or at least, change something in the makefile).

But what is a makefile? The gnu "make" is a tool for building software. Let's say you have a source code separated into a lot of files. And in order to compile the software you have to execute a series of gcc commands. Instead of type all these commands, you simply write a "Makefile", then you run "make" and all the commands are executed. Go read about makefiles... it's really nice and usefull.

Getting back to the subject, the second step is to compile the software, so you type make. After that, you generally execute the third step which is make install (the install commands are generally in the makefile either...). And then you got your software working.

Some makefiles even provide you uninstall commands. So if you want to uninstall something, just go into the source directory and type make uninstall...

Hope i could help you, sorry my poor english.


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