The question: “Is it better to install software from sources on Linux? Or from packages? Should I get the deb/rpm or the tar?” appears often among new Linux users. This article will try to give a response to these questions and show that we should be happy that we have so many choices and can use the one that is best for ourselves. Indeed, this question makes sense only on the Linux world. Here we have different choices. We can achieve the same thing using different methods. Still, this doesn’t necessary mean that one choice is better than another one; it might just mean that some options are better for some situations and some for other situations.
This question is pointless for a windows user. Does it make any sense to ask the regular Windows computer user how will he install a new piece of software? Of course not, because the answer will most certainly be something like: “Iâ€™ll buy the software, insert the CD/DVD and the installation will start automatically. I will click several times next (this is really annoying and hope Microsoft will fix this in their next version) and that’s it”. Is this simple? Yes of course. Is this the best way? It doesn’t matter because it is the only way.
Installing from sources
You might have heard from different peoples that installing from sources is the best choice. You have complete control, you can choose the options you want enabled or not, etc. Let’s see what are the advantages and disadvantages of running software from sources: ADVANTAGES:
definitely the most important thing is that you have full control: besides the simple ./configure; make; make install; you can customize the software based to your needs. You can leave out some features, or enable some non standard ones.
another advantage is performance: you can build the software on the running system and apply optimizations for the specific system. The increase in performance will range based on the application itself (this can be very small unnoticeable improvement, to a serious performance improvement).
time consuming: the compilation can take a long time to complete based on the size of the application and the system it is running. During the compilation the system will use resources (CPU) to build the application and this might not be a good thing on a live system.
it doesn’t scale very well: if you are doing this on one machine this can be ok. But what if you are doing it on 100? Is it worth it? You can choose to deploy the compiled binaries on more systems, but this will be just a primitive packaging system ;–) .
security upgrades will be needed to be performed manually also: you will need to monitor properly and install any security related upgrades of the applications.
handling of dependencies: is not so easy, an can cause extra problems when missing prerequisites need to be installed.
For sure any average Linux user had to compile at some point from source an application. Gentoo is the exponent of building everything from sources. You can compile and optimize every software possible on your system. It sounded like a great idea to me also a few years ago. But after I have worked with it for a while, I just realized that I was using a lot of resources in building software upgrades that was not bringing me a real advantage. And everything on a live system running a successful site. When I had to expand the system to 10 systems do you think I have chosen to still use gentoo? Or did I choose a ‘binary’ distribution? Of course. I made my choice based on the particular needs I had.
Installing from packages.
Each Linux distribution is somehow ‘packing’ the applications they provide bundled with the distro. This is one of the most important things you should look when choosing a linux distribution: what packages they offer and how do they compile them. The installation from packages (even if you might have heard of things like ‘rpm dependencies hell’) should be very easy and straight forth. Let see the advantages and disadvantages of running software from packages: ADVANTAGES:
fast and easy: the packages are in complied form so the process normally involves to download the package and their dependencies, and to install (decompress them).
easy security updates: these days any respectable linux distribution will have an easy way to track and install security related upgrades. The important thing here is to release the updates fast enough, and to make it easy (automated) to maintain the system updated.
you lose control. You no longer choose the compilation options and they will mostly be done to work for most peoples. Those choices go are taken by the peoples that create the packages, even if those are employes of a private company like RedHat or members of a community like the Debian developers.
performance penalty: the packages will normally build on an architecture that will run on most hardware. Most distributions still build on i386 (meaning the software will work on any archaic computer). Distributions like Mandriva for ex. compile their packages for i586, and our days most distros will have an amd64 version with the ever increase usage of 64bit CPUs.
availability: not every software will have a package. And if it does it might not have for your distribution, and in this case you will be force to compile it from sources or help the community by creating a new package. Some distributions like Debian will include a huge list of software packages, while others will have smaller lists. Even in this case you might use 3rd party repositories that provide community build packages.
Any Linux user will have his preference. There are advocates of RPM or DEB/APT that will say their system is the best. The truth? On most modern linux distributions (either debian based, or rpm ones) the installation of new packages will be very easy and the way to go for a fast and simple install.
Ok then. But the question still remains… what is the best choice? I have tried to show is that both choices are good. They are good for some situations and it is a great thing we can choose what we will use. Let’s say you are a Linux enthusiastic and you want to get the most of your system. Using gentoo and compiling every piece of software you run on the system sound normal? Sure it does. You are a sysadmin managing a server farm collocated in a remote datacenter? Running debian or rhel consistently on all the systems would sound normal? Of course it does.
Going further: on the usage of the linux distribution, you will choose the one that is best for you. If most of the resulted debian packages will be close to what I would build myself, it is just normal for me to use Debian, right? Does this mean that Debian is better than RHEL? No it doesn’t. It just means that for me Debian is the best choice for my needs. And nothing stops me form customizing and creating my own debian packages if this will be useful (read deployed on several systems).
I hope you found this article useful and it will help you make better choices :–) .