Slashdot Mirror


Build From Source vs. Packages?

mod_critical asks: "I am a student at the University of Minnesota and I work with a professor performing research and managing more than ten Linux based servers. When it comes to installing services on these machines I am a die-hard build-from-source fanatic, while the professor I work with prefers to install and maintain everything from packages. I want to know what Slashdot readers tend to think is the best way to do things. How you feel about the ease and simplicity of installing and maintaining packaged programs versus the optimization and control that can be achieved by building from source? What are your experiences?"

37 of 863 comments (clear)

  1. Support by ackthpt · · Score: 5, Insightful
    After you've gone it will be easier for the prof to get support on a package than something custom. From experience, the less something you have resembles what tech support is expecting the more finger pointing and the less gets done.

    As often as I've lamented how much employers spend on PC's, vs build them themselves from parts, they would rather not have to rely on someone in-house to support hardware.

    --

    A feeling of having made the same mistake before: Deja Foobar
    1. Re:Support by vrTeach · · Score: 5, Insightful

      This is very much the case. I have managed 15-20 linux machines for the past seven years, and have moved from largely building from source to largely depending on packages. The porting of apt to rpm systems has completely changed my work for the better, so if at all posible I use the packages and a small subset of apt repositories. My next step is probably develop our own apt repository.

      In some cases, the packaged version won't play well with something that I need, or I particularly don't want upgrades to disturb something. In that case I put together a pseudo-script that gets and builds the source and dependencies, and mark the packages as "Ignore" in my apt configuration.

      eks

      --
      -- Mein Systemadminstrator hat einen großen schwarzen Moustache.
  2. Gentoo is something of a middle ground. by Novanix · · Score: 5, Insightful

    Gentoo is a great OS as instead of having binary packaged systems, it builds everything from source but can build it effeciently and automatically. In addition it can allow you to just use it to manage the source and you compile it yourself. If you were dealing with many systems you could setup your own gentoo sync server and distribute custom copies of various packages exactly to your specs and compiling details. In addition it can easily determine dependencies, and even install them for you if needed. Gentoo is kind of like a bare bones OS that simply makes it easy to install whatever you want and rather helps shortcut the process of dealing with installing things by compiling things for you.

    1. Re:Gentoo is something of a middle ground. by Chuck+Bucket · · Score: 5, Informative
      Thanks for the very good points and explaination of Gentoo, but *please* remember, you CAN use binary packages with Gentoo as well:
      • emerge -k (packagename)
      This must be pointed out before the normal Gentoo FUD starts getting thrown around. Also, before anyone slams Gentoo, they should read and learn: Dispelling the myths of Gentoo Linux, an honest review

      Cvswdsf
    2. Re:Gentoo is something of a middle ground. by whoever57 · · Score: 5, Interesting
      I have one Gentoo machine that is my "Compile Server" On this, I build binary packages, which go into the portage tree. All other Gentoo machines on the network then sync against the compile server (instead of using "emerge sync"), and thus also get the binary packages.

      Then, on the other machines, I install from the binaries.

      This allows me to test the installs first, resolve any problems, etc.

      Furthermore, to speed up the process, several machines run DISTCC and are used as clients of the compile server.

      --
      The real "Libtards" are the Libertarians!
  3. Who are these people? by bperkins · · Score: 5, Insightful

    While building from source can be fun, and necessary sometimes, I don't think it makes sense. You spend far too much time tweaking minor issues, and lose sight of major problems.

    One problem that I've noticed is the fact the build from source people tend to install things in a way that's completely different than anyone else. This means that anyone who tried to maintain the machine is hopelessly lost trying to figure out what the previous person did. OTOH, When (e.g.) RedHat does something weird, the explanation and fix is usually just a few google queries away.

    Most (all?) package formats have source packages that can be modified and rebuild in case you need some really special feature.

    1. Re:Who are these people? by Anonymous Coward · · Score: 5, Interesting

      Speaking of RedHat doing something weird... RedHat managed to _rename_ p_pptr to parent in task_struct in the kernel. How did they manage to get away with something like that? If there are custom kernel modules that happen to want to use p_pptr, then everything breaks!

    2. Re:Who are these people? by bwy · · Score: 5, Insightful

      You spend far too much time tweaking minor issues, and lose sight of major problems.

      Good point. There are probably very few cases where spending the extra hours of tweak time ever ends up being something that adds a significant amount of value to anybody, except yourself of course. I can think of a couple exceptions, but they are exactly that- exceptions to the rule. IMHO the ability to standardize installation packages is an important aspect of modern computing.

      If time didn't matter, I suppose we'd could all go so far as writing all our own software that would do exactly what we wanted.

  4. Whatever get the job done by untermensch · · Score: 5, Interesting

    If you are working for someone else, maintaining servers that are intended for peforming specific tasks, then I think the best solution is to do whatever is most efficient at performing those tasks. If you really don't need the peformance gains brought by compiling from source (and you probably don't) and it's going to take you a long time to do the compiling, time that could be better spend actually doing the research, then it's not worth your effort. If however the compiling doesn't affect the user's ability to be productive and that is what you as sysadmin are most comfortable with, then it seems reasonable that you should be able to maintain the boxes however you like.

  5. Simply by AchilleTalon · · Score: 5, Insightful
    build packages from source!

    Many sources include the SPEC file required to build the package.

    --
    Achille Talon
    Hop!
  6. --No-Deps by Doesn't_Comment_Code · · Score: 5, Insightful

    My biggest grievance against packages is the dependacy fiasco. For instance, I have Red Hat at work. And the majority of the programs are .rpm's. Well there was a certain program that I could only get as source, so I compiled and installed it. It turns out that it was required as a basis for other packages I wanted to install. But when I tried to install those, it didn't recognize the prerequisite programs because they weren't installed via rpm.

    I don't care for the dependancy model of packages, and I'd much rather install programs myself. That way I know I'm getting the program compiled most efficiently for my computer, and I don't have to worry about dependancy databases.

    --

    Slashdot Syndrome: the sudden, extreme urge to correct someone in order to validate one's self.
  7. My experience by TwistedSpring · · Score: 5, Informative

    is that compiling from source can sometimes even be slower executing depending on your compiler.

    Also, better to install from packages because:
    1. They WILL work
    2. They install fast
    3. They are easilly de-installed
    4. They are painless
    5. Dependencies are installed automatically sometimes, and other times packages are the only way to resolve a dependency loop
    6. Most other OSes since the dawn of the home computer use pre-compiled binaries, and nobody has complained
    7. It is surely the developers job to make sure it compiles properly and do all the compiler error headache solving

    Packages are just so much nicer. A lot of the time, I can get pentium-optimised versions of the ones I want, and if I can't then 386 optimised versions are OK by me. The difference in speed one sees is pretty much only for the anally retentive, it is so minimal.

  8. Depends by Richard_at_work · · Score: 5, Insightful

    I use OpenBSD, which like most of the BSDs has the ports tree, and also has packages. Most of the ports tree are built as packages and are available on the FTP sites, allowing you to either install 3rd party applications from source preprepared for the job, or install the package that has already been preproduced from that port. Best of both worlds, and indeed if you are after customisation and have a number of systems, you can make the changes on one system, and bingo - you have the package ready to roll out to the other systems.

    As for what I use? I used to use solely ports, but now I usually grab all the packages when I do a fresh install, and only use ports for what isnt available as a package, as the packages give me no disadvantage.

  9. From source, definitely. by mod_gurl · · Score: 5, Insightful

    If you're responsible for the machines you run how can you abdicate that responsibility by using whatever some package maintainer decides to give you? At the University of Michigan we use Linux from Scratch to manage hundreds of machines that provide everything from web servers to IMAP servers to user Desktops & Laptops. The trick is leveraging the work used to administer one machine well out to hundreds of machines. The tool for this is radmind. Radmind doesn't require that you build your software from source, but it leverages the work you put into one machine to manage all of your machines. It also integrates a tripwire with your management software which means you can detect unwanted filesystem changes in addition to managing software.

  10. Source and un-install by KenSeymour · · Score: 5, Insightful

    I would have to agree about using packages. One gripe I have about building from source is
    that most packages do not have "make uninstall".

    With packages, you have a much better chance of removing all the files that were installed with the packages when you need to.

    --
    "We can't solve problems by using the same kind of thinking we used when we created them." -- Albert Einstein
  11. Re:One word for you... by micromoog · · Score: 5, Funny

    . . . which of course is dying.

  12. Stow! by Abcd1234 · · Score: 5, Informative

    Personally, I use both binary packages and source. Basically, if my distribution has binary packages, and they fit my needs (recent enough version, etc, etc), I'll just use the packages. Why not? However, if I do decide I need to build something from source, I like to use GNU Stow to manage my software. Basically, Stow allows you to install your from-source packages in a nice, sane hierarchy (eg: /usr/local/packages/this-program-1.0, /usr/local/pacakges/other-program-2.4), and then Stow does the job of setting up symlinks into the traditional Unix filesystem (typically /usr/local). So, by using Stow, you get the easy management features of packages (minus dependency resolution) for your from-source build software. It's definitely saved my life... and it's especially useful in an NFS environment, as you can export your packages directory and then use stow on the workstations to install individual packages as you see fit. Quite handy. :)

  13. Re:Personally by allyourbasebelongtou · · Score: 5, Interesting

    In short: I have to agree--I do a bit of both, too.

    The main thing I encounter that keeps me from using them all the time is the need for specific add-ons that are available as part of packages but are available when rolling-my-own.

    As an aside, there are certain bits that I just prefer to compile myself for any number of reasons

    That said, there are other bits of software that are pretty generic items that the packages make *trivially* easy to work with, and where compiling those same things from scratch--particularly on older hardware--makes you get a bit long-in-the-tooth waiting for the compile to return.

    To me, this is truly one of the ultimate beauties of open source: you're not stuck with pre-built, but you can leverage it when it makes sense.

    --
    ----------
    Nope. Not gonna do it. Wouldn't be prudent. Not at this juncture.
  14. Source Builds = Administration Nightmares by JM · · Score: 5, Insightful

    I used to run an ISP, built everything from source, but eventually it got to the point where it was un-manageable.

    You end up with different versions, different compile options, upgrades are a mess, and it's hard to support.

    Another problem is filesystem pollution. When you do your "make install", it's hard to track what files are installed, and when you upgrade to a new version, you can't be sure it's clean, since you might have configuration files or binaries anywhere on your system.

    So, one day, I started to make RPM packages of stuff I needed, and modified existing RPMS, and sent all the patches to the community.

    What happened is that Mandrake accepted all my packages, so all I had to do was to install the standard distro, and all I needed was there.

    And eventually, I made so many packages that they hired me ;-)

    But even if I wouldn't work for Mandrake, I'm still sold on RPMs. You have a clean SPEC file that contains the pristine source code, plus the patches, and basically all the instructions to build the stuff. You can specify the requirements, you can easily rebuild on another machine, uninstall the old stuff, or upgrade, with a single rpm command.

  15. make your own "packages" by drdanny_orig · · Score: 5, Insightful

    I use fedora, and most often I get the *.src.rpm versions, then tweak the SPEC files as required, build my own binary rpms, and use those. Best of both worlds, IMO.

    --
    .nosig
    1. Re:make your own "packages" by tjwhaynes · · Score: 5, Insightful

      I use fedora, and most often I get the *.src.rpm versions, then tweak the SPEC files as required, build my own binary rpms, and use those. Best of both worlds, IMO.

      And the tweaking need not be that tricky or time consuming either. Decent defaults for building RPMS can be placed in your ~/.rpmrc file (or /etc/rpmrc, etc.). Once you have set your optimising settings, architectural preferences and packager name and cryptographic signature (if you want to submit them to other people), that's done for all future packages.

      I used to run a mix of RPM packages and tarballs (./configure --prefix=/usr/local && make && su -c "make install") so I could tell what was under RPM control and what was not, but it became annoying when I wanted to build a Source RPM with dependencies on a package I had built from tarballs. These days I usually try and wrap any install up in an RPM - it's not difficult once you get hold of a skeleton spec file for your distro and it saves much hair pulling later on. Also the dependency requirements of RPMs actually save time in the long run because you know when removing a package will hose your system (or part of it) .

      Cheers,
      Toby Haynes

      --
      Anything I post is strictly my own thoughts and doesn't necessarily have anything to do with the opinions of IBM.
  16. Building from source is often just a bloody waste by multipartmixed · · Score: 5, Insightful

    ..of time.

    It's like the programmer who spends six hours hand-optimizing the inside of a loop that gets called once a day and already executes in 10ms... but ignores the fact that the program takes 20 times longer to run than it should because of an inefficient algorithm. This programmer doesn't know *why* his program is slow, he's guessing, and he will almost always guess badly. This is why profiling was invented.

    Look at it this way. Installing from the packages you get the following benefits:
    - You save time compiling (multiply this by the number of patches you have to add over the box's life time)
    - You save time tracking down dependencies
    - You have a standard platform you can re-deploy at will
    - You have something that another administrator can work on without asking where you shoved shit.
    - You have a package database you can query for version information, dependencies, etc.
    - You have an easily available source of "known good" binaries if you have a suspected intrusion problem.
    - Depending on the package system you use, you might be able to stay on top of security vulnerabilities with very little (or no) work.

    Now, installing from source, you get the following benefits:
    - You can pick where the files go (whoopie)
    - You tune the performance for your platform
    - You can select specific features
    - You can de-select specific features to save disk space

    The only one which gains you a lot 99% of the time is where you can select specific features which are turned off in the standard package. If you need those options, you build it from source. If you're doing ten machines, though, you build it from source on *one* machine, package it up, burn it, and install it from YOUR package on all ten machines.

    Saving a few CPU cycles is never worth saving a man-hour. You can use the man hour more productively on the macro-optimization level. Similarly, you can take the dollars that you would be pay the man and buy a new CPU with it.

    The same argument goes for saving a kilobyte of disk space. If found out that any of my guys spent *any* significant time trying to cut less than a gigabyte out of our application footprint, I would give him a footprint of my own, right in the middle of his colon. Disk is cheap. People are not.

    If you have an application is which is CPU-bound and running too slow, find out why (profile the system or binary), and build from sources only what you need to make your application conform to the target specification. Or, if that will take too long, just buy more CPU.

    Long story short -- tuning of ANY kind should not be done at the micro-level across the board, that's just a waste of time. Tuning should be done by profiling the system as a whole, identifying the constrants, and relieving them. If that requires micro-tuning of a few things, that's fine... but squeezing every last little bit of performance out of absolutely everything is either impossible or incredibly time-prohibitive. And, of course, if you were going to spend that kind of time, you could either buy new hardware with the money (remember Moore's law), OR you example the system more closely at the macro level and come up with a better way to do things.

    --

    Do daemons dream of electric sleep()?
  17. Well, the *best* way is obviously... by gosand · · Score: 5, Funny
    Obviously, the absolute best way to maintain your systems is to install Windows Update. But since Linux is stuck in the dark ages, you'll have to manage your systems like the cavemen did.

    Now if you'll excuse me, I have to go reboot 100 systems.

    --

    My beliefs do not require that you agree with them.

  18. Re:Personally by Aneurysm9 · · Score: 5, Interesting

    You don't have to wait days to get a working Gentoo system. With the GRP CDs you can have a working system up and running in a few hours. It's still going to take more time than Fedora or SuSE, but it will be optimized more for your platform with the option of recompiling for further optimization. That's how I setup Gentoo on my laptop as it's hideously slow. Over time it's had almost everything recompiled a piece at a time, but I didn't have to wait for it to do everything from glibc up at once.

    --
    There was Cowboy Neal at the wheel of a bus to never-ever land.
  19. dear slashdot... by DrWhizBang · · Score: 5, Funny

    which is better, vi or emacs? ;-)

    --
    Schrodinger's cat is either dead or really pissed off...
  20. Re:One word for you... by SoTuA · · Score: 5, Funny

    Gentoo Linux: Because life is too long to waste on windows reboots, but long enough to 'emerge openoffice'. (laugh, it's a joke!)

  21. Not always the case by Anonymous Coward · · Score: 5, Interesting

    Sometimes the exact opposite is true, especially in terms of "community support". For instance, mod_perl, which for some reason Red Hat decided to ship a very early version. The typical response on the mailing lists for mod_perl or any other alpha/beta package RH included usually goes "try it from source, then email us" (that's after someone submits a reasonably complete bug report).

    Let's not forget the GCC fiasco and probably dozens of other examples where RH decided to "lead the pack" in terms of version numbers but not stability.

    Of course, then there's Debian woody, living in circa-2001 land.

  22. Use RPM's or DEB's if at all possible. by BenRussoUSA · · Score: 5, Insightful

    I've been a UNIX sys-admin for about a decade.
    My advice is that for a workstation that is managed by an individual you can let the admin do whatever they want, but for any server that has to be stable and maintainable you want to stick with a well maintained package repository and try to avoid 3rd party packages and tarballs if possible.

    You have to understand that there is a software stack in most services.
    With the kernel and core libs (like glibc) and such at the bottom of the stack, and applications like Evolution at the top of the stack. In between you can have gdb and openssl and various perl modules (in AMAVIS for example) and you have sasl stuff which may be related to pam and openldap and cyrus or wu.... etc..

    The thing is that even though all of those various pieces of the software stack may be linked against different libraries on the box, the maintainer of the library code may not have a QA group to co-ordinate regression testing and compatability testing before the latest CVS commit is enacted to fix a bug referenced in a CERT alert.

    RedHat and Debian and SUSE and all the others have package repositories, the repository maintainers do an amazingly fantastic job of QA and testing to make sure that new patches don't break your software stack. As an individual you simply can't keep up with that.

    For example the Development team that takes care of OpenSSL doesn't backport their bug fixes and security patches to old versions of the code. They just maintain the latest release version and the current CVS version. If you have an old server running IMAPs and HTTPs and SSH and SMTP/TLS and such, and CERT announces a bug in openssl vX.Y, then the OpenSSL development team will certainly release a patch for the latest version which may be version Z!

    That might cause you to have to upgrade APACHE or wu-IMAP or OpenSSH or Postfix etc... Those things might then have divergent dependencies that would cause you to go and rebuild half a dozen other packages, and so on and so on. Also, do you remember all the magic flags you used for configure and make? Do you have the same environment variables set today that you did the last time you built PostFix? The possibilities for problems are endless. And if you do have a problem you are kind of on your own since your system will be a unique box. Whereas if there is a problem with a standard RedHat or Debian package, then you can always go to the general newsgroups and chances are there are a dozen other "me too" posts with answers already.

    It is much easier to use apt or up2date.

    So, unless you have a very good reason for using a tarball on a production server that requires reliability and security and high availability, then you should stick with packages.

    If you want to build the packages from source, feel free! RedHat and Debian and SuSE make the SOURCE packages available so that you can dig in and read all about'em. I'm sure the Debian team could use a new package maintainer, if you are addicted to compiling and testing things, check them out.

  23. Re:Beyond personally - professionally by Shakrai · · Score: 5, Insightful
    Otherwise, I'd only build from source when there was not a trustworthy package available, or to add features, fix bugs, etc.

    If you can't find a site with a trustworthy package what makes you think you can find a site with trustworthy source code? Or are you going to review every line of code to make sure it wasn't tampered with?

    The paranoia works both ways :(

    --
    I want peace on earth and goodwill toward man.
    We are the United States Government! We don't do that sort of thing.
  24. Have your cake AND eat it, too! by tmoertel · · Score: 5, Insightful
    Packages and package managers solve a real problem: Keeping track of software installations, their files, and their interdependencies is hard, hard work. By packaging software and using good, "higher-level", package managers (like yum and apt-get) you can delegate most of this problem to the computer. That's a smart move.

    It's still a smart move if you're building from source. Just package your source. Then you can build the sources under the control of a package manager (like RPM), and install the resulting packages. You get the full benefits of build-from-scratch and the full benefits of using packages.

    This is exactly the approach I use. In fact, I'm a bit more strict about it: My policy is that I don't install any software that isn't packaged. If I need to install something that isn't packaged, I'll package it first. If I don't like the way a packager built an already existing package, I'll repackage it.

    The bottom line is that creating your own packages (or fixing packages you don't like) is much easier than maintaining a from-scratch, unpackaged installation. Or ten of them.

    To get you started, here a couple of RPM-building references:

    Don't give up the benefits of source. Don't give up the benefits of packaging. Have them both.

  25. Re:One word for you... by TimmyDee · · Score: 5, Funny

    That's only because one can associate FreeBSD with Apple, who has been dying for longer than I have been alive.

    --
    Per Square Mile, a blog about density
  26. Re:Beyond personally - professionally by JAgostoni · · Score: 5, Insightful

    In the parent post's defense, you can almost always get the source code from the "source" or author. However, sometimes you rely on some other guy to produce a .deb or .rpm or whatever which you might not trust as much as the author.

    I almost always trust packages from the vendor and the distro and only trust "3rd party" packages when there's been tons of anecdotal evidence that they work.

  27. Re:Personally by jobsagoodun · · Score: 5, Interesting

    BUT

    The really great thing is how well it wears. I've a RH8, RH9 installation that have lots of other bits & bobs installed, mainly from tgz's I've pulled down & built. Its an arseabout, and both boxes are cluttered with stuff - and as soon as you go off piste with an installed package, you're on your own.

    OTOH I also have a couple of gentoo installations, and for nearly everything I want, I can just 'emerge xyz' and presto, its there. It was a pain getting it installed, but now its there it is really, really good. Also upgrading it was piss easy too.

    If only I could get portage/emerge for redhat...

  28. Re:Personally by Frymaster · · Score: 5, Insightful
    In my opinion if Gentoo wants to gain a larger user base it needs one.

    and why does gentoo need or want a larger user base? gentoo is geared towards a niche market and those people will be attracted to the distro whizzy installer or no.

    porsche has a tiny market share - but nobody suggests they should make a k-car version to get a bigger slice of the pie!

  29. Amen. by Sevn · · Score: 5, Insightful

    What some people don't seem to understand about Gentoo or the BSD's is that not everyone is hell bent on world domination and market share. Some people want something specific, and Gentoo and the BSD's are there for them. It's not like they are ever going anywhere. BSD "despite the rumors" has never done anything but grow in usership with the steady, yet slow trickle of new users and the fiercly dedicated long time users. Gentoo is growing rather fast, but will no doubt plateau off and settle in the same way the BSD's have. But by all means, continue to have your OS flame wars and make your comparisons and talk about market share or other things that aren't important or even remotely interesting to the majority of most Gentoo and BSD users. It's very humorous. :) HAVE FUN STORMING THE CASTLE!!!

    --
    For every annoying gentoo user, are three even more annoying anti-gentoo crybabies. Take Yosh from #Gimp for example.
  30. Different stages by matt-fu · · Score: 5, Insightful
    As far as as I can tell, there are four stages of sysadmin as it relates to installed software:

    1) I am a newbie and have to use packages for *.
    2) I know my way around. I like the level of control I get with compiling/know how to code/read far too much Slashdot. I compile by default.
    3) I manage more than three boxes in my basement now. Having the ability to back out of system changes without a full OS reinstall is a necessity. I build my own packages from source that I've compiled.
    4) I manage more than just three boxes in a department now. Now I have to deal with politics, ordering hardware, the freakin' network, and I generally have time for sysadmin. On top of all that I now have a family so spending two or three extra hours per day on my Unix hobby is no longer feasable. Precompiled packages work just fine.

  31. The point? by Anthony+Boyd · · Score: 5, Insightful

    Wow. There sure are a lot of posts about which is better, but I don't see any comments that deal with the underlying problem. And that is this: don't get into a pissing match with your professor. Seriously, what are you hoping to accomplish here?

    If you were thinking that you'd get tons of pro-compiling comments, and then put that in front of the professor, stop right there. Coming to Slashdot for validation of your side of the argument is about as helpful as those wives who write to Dear Abby about their husbands. Because no husband on Earth is going to appreciate getting chastised by Dear Abby, and if Abby sides with him, he's going to gloat. It's lose-lose for the wife, just like it's lose-lose for you if you try to use Slashdot as leverage. Screw with the computers that the professor relies on, and he'll find a way to "thank" you for it. Don't sabotage yourself.