Slashdot Mirror


Binary Package Formats Compared

jjaimon writes "There is a document on different package formats used in Linux/Unix systems. Worth reading." Another reader sends in this guide to creating Debian packages which seems apropos here.

24 of 292 comments (clear)

  1. Good God, You're starting a flamewar! by Trigun · · Score: 4, Funny

    Why don't you just ask what everyone's favourite distro is?

    Apt-get, no emerge, no make world, ARRRGH!

  2. Re:counterproductive by ae0nflx · · Score: 4, Insightful

    It is silly for us to ignore such a large divide in our community though. It exists, therefore we should look at it in depth so we can improve it and better the community as a whole. We shouldn't set off a battle cry for the entire community to come together if that's not really what's going to happen, at least not in the reality that i see. but then again my personal reality distortion field is out of whack this week.

    The distroes are quite divided. How 'bout we look at what is specific to each distro so people can chose which is best for them. That is a better way to garner support from the outside community, doncha think? Don't leave them in the dark, that's what scares people away from Linux.

  3. Interesting... by slackr · · Score: 5, Funny

    First time I've ever seen guys compare packages and size doesn't seem to matter.

    Not compared: my favorite package

    --

    * Please do not read my signature.
  4. Deb vs RPM by GoRK · · Score: 5, Interesting

    I'm sure this will erupt into a huge flamewar like the last time it was posted when all it boils down to is that it doesn't really matter much to end users about the package format as long as the installation and upgrades are made easy. For me, aptitude/apt with .deb packages has proven easiest, but a lot of people like apt with RPM or RedCarpet or rpmfind or whatever else is out there. Lindows users use the 'one-click' install thing not even caring that there are .deb's behind the scene.

    Part of the reason, I think that the deb format has always seemed to hold together really well is that most all of teh deb using distributions are so tightly integrated with the main debian distribution that packages are always totoally interchangeable (and are very good to notify you when they will not work.)

    RPM on the other hand is adopted by many different and sligtly incompatible distributions that often finding the libraries and applications you want to install is difficult not because RPM's are hard to find but because RPM's that work in your current setup are hard to find.

    This is simply why the management tool(s) on both ends (creating packages and maintaining installed packages) matter way more than the package formats themselves. Deb's are very compicated but sometimes easier to deal with because of all the good debhelper tools. RPM's are most often more 'hand-crafted', but they are a lot easier to create from scratch for many people.

    The thing I really hate about deb's is the lack of signature verification. It's absolutely central to the development/upload/build process but until very recent efforts has been a total pain to use on the installation front. There is no good reason for this either.

    ~GoRK

  5. APT (DEB) vs ??? (RPM) again. by Speare · · Score: 5, Insightful

    There are different levels of package management which often confuses the newcomer into believing (dogmatically) that one is better than the other.

    The installable packages themselves have to have flexible dependency markings and coherent version markings. The low-level package tool has to be able to install and uninstall packages cleanly and repeatably. Seems like the dpkg/deb suite and the rpm suite are quite comparable here.

    The package manager has to be able to build a requirements tree for a desired package, and then fetch all of the required packages to fulfill those dependencies on the local system. It should offer trust or signature verification to ensure only trusted repositories and trusted packages are used. The apt tool seems to be cross-platform, while non-Debian distros often spin their own service model here: up2date, Red Carpet, and whatever Mandrake and Lindows offer are each commercialized with some amount of sample access.

    Lastly, the most important criteria, is the repository itself: it should contain packages which are clean and trustworthy. There have been cracking incidents, and there will be more. The quality of code between distro-produced packages and externally-produced packages can be as different as night and day. The package's meta-data and manifesting information can be crap, or it can be carefully constructed. The embedded installation scripts can be trivially exploitable or they can be carefully scrutinized against unexpected results.

    Even if your package format is cool, and your package manager is cool, consider the repository. If the repository is not secure and offers poorly tested packages, many folks are going to unfairly blame it on the tools.

    --
    [ .sig file not found ]
  6. Re:Binary packages: Security suicide by duffbeer703 · · Score: 4, Insightful

    Are you smoking crack?

    Having a compiler available on all of your systems to compile C code is far greater risk than the "threat" of getting trojaned builds from Red Hat.

    Take your tinfoil hat off and breathe.

    --
    Conformity is the jailer of freedom and enemy of growth. -JFK
  7. 5 years old! by spotter · · Score: 5, Informative

    Joey Hess created that document (at least the first revision) around 1998 IIRC, so it's not so much new news (guessing it's been posted here before, but probably around then as well)

  8. LINUX needs to tell apps where they live! by Arslan+ibn+Da'ud · · Score: 5, Interesting

    What Linux really needs is a dir-independent application running
    system. Imagine a package of...oh, say, g++, where g++ runs properly
    even if you move the whole g++ package to a different dir (say from /usr/bin to /usr/local/bin). Most packages, including g++, configure
    themselves to run in one location, and they'll get confused if you
    move 'em.

    Some packages (eg Tomcat) let you move them and they'll still
    work...but only if you set an environment variable (eg TOMCAT_HOME)
    so that Tomcat now knows where it lives. In a proper environment, an
    application could easily & consistently know where it currently
    resides on the filesystem *cough* OSX *cough*.

    What Linux needs is some standard 'run-app' script that would inform
    a package of its location. For instance:

    % run-app tomcat

    Run-app would be simple, say, the following:

    #!/bin/sh -f

    $app = shift
    $location = `which $app`
    env {$app}_home = $location $location/bin/app

    That would enable Linux to devise a package format (or better yet,
    improve rpm, deb, etc) for more flexible package management.

    A package would no longer need to place its binary, libraries,
    manpages, etc. all in hardwired locations in the OS...it could just
    leave them in its original dir. (or maybe create a 'obj' dir that you
    can remove if you wish to clean up the package.)

    --

    Practice Kind Randomness and Beautiful Acts of Nonsense.

    1. Re:LINUX needs to tell apps where they live! by leviramsey · · Score: 5, Informative

      RPM's are relocatable (at least most, if not all of the packages Mandrake distributes are; hardcoded directories are against Mdk policy and caught by rpmlint). Just edit your .rpmmacros and set macros like %{bindir}, %{libdir}, etc.

  9. Re:Why get binaries by serial+frame · · Score: 4, Insightful

    Believe it or not, like (essentially) all things, binary packages have a purpose, just as source packages have a purpose--platform agnostism.

    Before giving me an explanation as to why you (read, the parent poster) in particular would not have a use for binary packages, allow me to explain why binary packages are useful. In the majority of instances, binary packages are useful when one is installing the userland on a system, or when installing a compiler, when you have no other systems to build the compiler on. Binary packages are also handy for systems where compiling from source would be inconvenient, resource-intensive, and time consuming.

    Also, there are some proprietary applications that are not available as source, so a logical manner of packaging is with a standard binary packaging system such as RPM or dpkg.

    Even NetBSD has its own binary package format (no, not the sets, those are for the base install and are just tarballs without package information).

    All in all, binary packages are very convenient, despite the inconveniences caused by vendors who do a poor job of managing their package collection and dependencies. Binary packages are single files, smaller than source archives in most instances, and are installable in a uniform manner.

    Let's not get into rogue "package vendors" who package trojans. They are the minority, and most reputable software developers release their own binary packages along with sources anyways.

    I think I need a glass of water.

    --

    -
    And the Angel said unto me, "These are the cries of the carrots! The cries of the carrots!"
  10. Re:Binary packages: Security suicide by dissy · · Score: 4, Interesting

    One of the main reasons I enjoy DEB binary packages which also do not have any of the bad issues you mention is this:

    I'll download the source and compile it on my nice fast zippy P4 2.6ghz machine, then build a .deb from that, not just to install on that machine (Personally I like the fact i can remove it with a package manager) but i can also install that binary package I made myself on my slower systems that dont have a compiler installed.

    My three router computers are all p133 or p166 machines. No way am I compiling anything there. Routers also dont need gcc installed.

    I run my own private apt repository for this (Its just apache and some config files in text format, and one more line in my apt sources file.)
    This way I can tell whichever machines to apt-get it, and later I can apt-get remove it as well.

    I also dont have a huge server farm, I just have 8 machines at home for different purposes. Below the P4 mentioned above, my next fastest system is a p2 450. The others get way slower below that (p2 200 and the like, or worse.)

    I also dont want a compiler on any system but my development system. The machines in my DMZ dont need compilers, as if they do happen to get rooted, that's one less tool for them to use aginst me.

    Open source is also about choice. Please let us have ours, even if you have made your own.

  11. RPMs, an' all. by caluml · · Score: 5, Informative
    How to roll your own RPMs. Very useful. You can open up a package, say postfix, or mozilla, customise the config files for your organisation, and re-make it. Then you can just install at your leisure.

    Best thing about RPMs? GPG signatures built in. Try rpm -K whatever-x.x.x.rpm next time. Second best thing? rpm -Va.

  12. Re:Why get binaries by Wdomburg · · Score: 5, Insightful

    Because some people have older machines that take several days to compile large subsystems such as Gnome and KDE?

    Because some people run dozens or hundreds of machine with identical configurations, so compiling the same package on every single machine is pointless?

    Because companies prefer working against a known build of a piece of software for support reasons?

    Source distributions are far from a panacea.

  13. Ah yes, packaging by Dark+Lord+Seth · · Score: 5, Interesting

    Definitely one of the features which makes Linux a powerful OS. A good and well-configured packaging system can be a blessing, automagically resolving dependancies or at least telling you where and how things will fuck up. The problem with package managers is that there are quite a few of them around. Normally, diversity would be a good thing but those package managers don't seem too willing to process eachother's packages...

    For example, RPM packages are almost common these days; most open source software has a few packages ready to be implemented. Pretty much the same thing with Debian packages, because of the large userbase. Chances are that a few hours after the release of a major product someone has made a .deb somewhere, ready for you to install. However, if you'd look beyond these two packaging systems, you'd get a few nasty surprises...

    The TGZ packaging scheme (also mentioned in the article, along with RPM and DEB) just... Well... Sucks. Or at least in Slackware, I don't know if any other distributions use it differently but lets use Slackware's TGZ system as an example for now. What's wrong with it, you ask? First of all (and possible the foremost reason) it's almost unused. Apart from the Slackware packages itself, I've never seen anyone distribute something in the TGZ format which worked. That excludes the few things which I found and simply refused to install. It doesn't do dependancy checking, conflict-checking, heck, it doesn't do anything or so it seems. I'd continue but ranting about the bad parts of Slackware isn't the issue at hand.

    The issue at hand are the two remaining package systems, which might be technically sound and quite useable, but they still won't have allot of use. Who here has ever heard of SLP and PKG packages? And even then, who here knows of any major applications which distribute their software using those package systems? Sure, SLP and PKG might be a dream to use, but without any actual packages to install, they're (possibly sadly?) not really of any value.

    Which brings us back to RPM and DEB, apparently two of the most common systems, courtesy of Red Hat and Debian. Looking at the list of summed up data, it's really not a miracle those two are more common: Both support mostly options listed, both are backed by a large amount of users/developers and both are relatively easy to use, yet still distinct. Perhaps a system which allows multiple systems to cooperate (regarding dependancies and conflicts and the like) would be a nice compliment to both RPM and DEB?

    1. Re:Ah yes, packaging by dissy · · Score: 4, Informative

      > The TGZ packaging scheme (also mentioned in the article, along with RPM and DEB)
      > just... Well... Sucks.

      Not intended as an attack aginst your comment (You are fully correct, it sucks) but to clarify a point: .tgz is not really a package format. .tgz (.tar.gz, or a compressed tape-archive) is no more a binary package format than .zip is for windows.

      Slackware created a rather elegant hack at the time, of having a /package/install.sh script in the tarfile which is run with a bash shell after the files are extracted to do any command based setup, but that is it.

      Imagine if you will, a .zip file that states 'uncompress this file exactly here C:\windows\system\whatever\foo.bin '
      That is all a .tgz can do.

      This is why it supports no dependencys or checking, because its just an archive file.

      Technically speaking, this isnt a package format as much as a creative way to run a shell script after extracting some files.

      * I realize you were just replying to the articles claim that it is a package format, and from your own experences. I just wanted to explain why your experences sucked... It was more of a design flaw to use an archive as a package format, then the package format sucks.
      From an archive stand point, .zip and .tgz do great.

  14. Re:Binary packages: Security suicide by GammaTau · · Score: 4, Informative

    The binary distributions usually come with a way to compile your own binary packages if you wish to inspect the source code. Just download the source RPMs or use "apt-get source". The "binary distributions" are generally binary and source distributions where you can choose whether you use prepackaged binaries or compile your own.

  15. Ah, another linux-only discussion by softweyr · · Score: 5, Interesting
    Gee, I would've loved to have seen this include the BSD package format, and perhaps the Mac OS X one too. Sigh. For what it's worth, they score fairly well on the feature comparison chart, similar to RPMs.

    All of these formats could be done better. The OpenPackages project had a design project underway to consider the features of an ideal, multi- platform package format early last year but it seems to have died from lack of input. It'd be great to see it get a breath of new life. If nothing else, this article could serve as a starting point for what we do and don't like about current formats.

  16. Re:Binary packages: Security suicide by buddha42 · · Score: 5, Funny
    Yea! I totaly agree with the above poster. For instance, the first thing I do when I sit down to use a computer is take apart the keyboard with a screwdriver. You can never trust that someone hasn't installed a keylogger.

    Every time I've bought a car I bring a socket wrench set with me and tear apart the engine right there on the dealership floor. If I didn't how could I know that Al Queda hasn't set me up to be a pawn!?! Not checking your equipment like this is tantamount to supporting terrorists.

  17. Technically... by serial+frame · · Score: 4, Informative
    From a technical standpoint, I find that creating a Debian package would be far easier than creating a Red Hat package. Essentially, a packager does not require any special tools to create a package; all one needs is ar, tar, and gzip, and a text editor to write the package control data. This feature-by-design allows poor ol' me, without any Debian machines, to create packages, assuming a similar development environment and libraries as the Debian environment I'm targeting (which really should not be hard, provided the libraries I use are of the same version).

    Similarly, I could install a Debian binary package if that were all that existed for my particular environment, with a simple

    $ ar p data.tar.gz package-arch.deb | (cd /; tar -p -zxf -)

    (I digress, simple may be relative)

    On the other hand, since RPMs have a special binary header, the lazy would be forced to install RPM and Berkeley DB on non-Red Hat-machines in order to build an RPM package. Though it is possible to extract the gzip'ed+cpio'ed data in an RPM without using rpm.

    So, in my view, Debian has a bit of an upper hand in simplicity, from a technical standpoint, but not by much.
    --

    -
    And the Angel said unto me, "These are the cries of the carrots! The cries of the carrots!"
    1. Re:Technically... by debrain · · Score: 5, Insightful

      Actually, the point goes much further than this. If you are on a RPM system and you lose control of RPM, either through library problems or dependencies, or what have you, you suddenly are robbed entirely of your ability to control the packages on your system, usually including the ability to fix the system itself.

      This is not something anything but highly technical users, or even faint of heart, will encounter. However, it is something that has undermined my ability to recover from catastrophic failures on machines with RPM that do not have CD or network access. I have even been reduced to binary manipulation of RPM files to extract the cpio compatible archive (not a task I would undertake lightly).

      In contrast, with Debian packages, I have been able to rebuild a machine from scratch with ar, tar, and gzip, which are extraordinarily unlikely to break. Even in the event that they are unavailable, one can copy them to lightweight media, statically compiled, and then they have no real dependencies. Even if dpkg or apt fails (the latter more likely than the prior, in my experience), it is almost always possible to recover from catastrophic mistakes.

      In summary, .deb seems to be a far superior package format to recover from catastrophic failures in system utilities such as the package manager. Of course, as you may have ascertained from my comment on cpio, I have experiences precluding bias. ;)

  18. The problem with RPM... by eyegone · · Score: 4, Insightful

    Is that the rpmlib API is almost completely undocumented. As GoRK pointed out, management tools such as apt, rpmfind, up2date, etc. are far more important than the underlying package format.

    But it's very difficult to create those management tools for RPM when the API is a "black art" known only to a few. Questions on the RPM mailing list/newsgroup will generally be met with the advice to "use the source, Luke"--all several hundred thousand lines of it!

    --
    "They that can give up essential liberty to obtain a little temporary safety deserve neither liberty nor safety."
  19. Re:Binary packages: Security suicide by Percy_Blakeney · · Score: 4, Insightful
    I don't understand why so many ostensibly clueful people are so enamored with the whole concept of binary distributions.

    ...

    Obviously, for large software packages, you probably don't have time to read every last line of code.

    That is the understatement of the year. I would dare say that in order to read and understand a program that is on the order of five million lines, it could take you a year or two. For a non-expert programmer (or even an expert with no operating systems experience) it could take forever to just begin to understand something like the Linux kernel source.

    But what I generally do is untar the source and then grep through it for suspicious things.

    That's great if you know what you are an expert programmer (and if you think that a simple grep will help you that much.) But what of the small business that doesn't employ you? Do they need to perform that same review? Of course, they could skip it and just compile the thing, but that is the same as just using the binary packages!

    You may as well just hang your Linux box out on the net with 500 open ports and no firewalls.

    Baloney.

    Because a well-hacked program will allow the hacker to get at your data, firewall or not.

    A well-hacked program will be completely invisible to you, as well. Your grep methodology is too simplistic to catch any sort of sophisticated trojan. Even if you were to laboriously go through the code, line by line, you still wouldn't catch anything but the most obvious of hacks/problems.

    The only way you can be completely sure is to read the source.

    No, the only way is to not run it. Software is not a mathematical formula that you can "prove". Large programs are horribly complex, as you most likely already know. Binary packages serve a very useful purpose for many people. If you choose not to use them and to perform some limited form of code review, then that is great for you, but don't try to demean anyone who doesn't do the same.

  20. Zero Install by tal197 · · Score: 4, Interesting

    Zero Install

    "The Zero Install system makes software installation not merely easy, but unnecessary. Users run their applications directly from the Internet from the software author's pages. Caching makes this as fast as running a normal application after the first time, and allows off-line use."

    • No new commands to learn. All software in the world appears as part of your filesystem (/uri/...) and is cached on demand.
    • Secure: nothing is run as root (only as the user who runs it), and GPG signatures can be checked automatically when upgrading
    • Network efficient: only what is needed is fetched (no documentation or headers until you need them, then they get fetched automatically)
    • Faster: no searching for resources -- everything is referenced by URI; only download package indexes per-site, not for the whole distribution.
    • Easy to package for: just make your tree available via an HTTP server.
    • No need for depends/recommends/suggests: whatever is needed is fetched when you access it.
    • Easy to uninstall: remove anything you don't want from the cache at any time -- it will be fetched again later if needed.

    Experimental, but give it a try. See especially the comparison with apt-get and the security model documents.

  21. what a day to post this by joey · · Score: 5, Informative

    I (author) am currently enroute to Norway, only found out I was slashdotted in the airport. I don't really understand why they posted it today, and not some time in the past 5+ years.. Anyway, I will respond to anything worth responding to sometime later.

    --
    see shy jo