52

What are these file formats and how do they differ from the .msi format in Windows? Also what are the pros and cons of these package management schemes?

2
  • 1
    .deb and .rpm are more similar to .msi than to .exe. Dec 3, 2013 at 17:10
  • 2
    note: asking "what are the pros and cons of rpm vs deb/dpkg" elsewhere on the internet carries with it the possibility of inciting a flame war.
    – strugee
    Dec 4, 2013 at 5:08

6 Answers 6

67

Files such as .deb and .rpm are more akin to a .zip file. They're a directory tree of files and sub-directories that contain files related to a particular application and/or library of files.

Distros

The .deb files are meant for distributions of Linux that derive from Debian (Ubuntu, Linux Mint, etc.). The .rpm files are used primarily by distributions that derive from Redhat based distros (Fedora, CentOS, RHEL) as well as by the openSuSE distro.

What's special about them?

These files have one other special trait that sets them apart from .zip files, in that they can include a specification that contains rules that tell the package manager software running on a system that's installing one of these files to do additional tasks. These tasks would include things such as:

  • creating user accounts on the system
  • creating/modifying configuration files that aren't actually contained in the .deb or .rpm file
  • set ownership/permissions on the files after installation
  • run commands as root on the system that's installing the package
  • dependencies, both formats can include names or packages and/or service names that they require to be present on a system, prior to installation.

What about .msi files?

.msi files are similar to .deb & .rpm files but likely even more sophisticated. The .msi files are utilized by the Windows Installer and offer additional features such as:

  • GUI Framework
  • generation of uninstall sequences
  • A framework within itself - for use by 3rd party installers
  • Rollbacks
  • Advertisement
  • User Interface
  • etc.

I'd suggest taking a look at the various Wikipedia pages on these subjects if you want a more in-depth explanation.

References

4
  • 3
    Since the answer starts with "Files such as .deb and .rpm are more akin to a .zip file" it might be worth mentioning that deb packages are actually ar archives, and rpms are (possibly in part) cpio archives. In the case of debs it is easy to verify that a deb can be unpacked with ar -x. In the case of rpm I don't know if this is possible. Dec 4, 2013 at 15:02
  • 1
    @FaheemMitha: rpm2cpio package.rpm | cpio -idv
    – ninjalj
    Dec 5, 2013 at 15:22
  • @ninjalj - thanks I forgot to add that command. I've used it to unpack rpms when I only wanted a file or two out of them. Usually the .spec files.
    – slm
    Dec 5, 2013 at 15:25
  • @ninjalj Thanks, I didn't know that one. Dec 5, 2013 at 15:29
35

The other answers touch upon qualities of .deb and .rpm that are similar to .msi. They all contain software in a compressed format that can do some extra things. Those extra things already mentioned included adding users, pre- and post-install tasks, registering the program with the system (e.g. windows registry, xdg-dirs, OpenRC/systemd init, etc).

What differentiates the formats (and is a huge pro) is dependencies. Both .deb and .rpm files can and do list names and versions of other programs that must be installed as pre-requisite software. By themselves, this is just informational, but...

You typically do not directly interact with .deb and .rpm files the way you do with .msi files. In fact, as alluded to earlier, a .deb is typically just an archive (ar or tar) compressed with xz with the contained files in a specific directory layout. Instead you use tools like dpkg and rpm to manipulate these files.

dpkg and rpm will install the contents of .deb and .rpm files and verify all pre-requisite software is installed. Running these programs is similar to clicking on a .msi file. Users however, do not typically interact with dpkg or rpm but instead use apt-get and yum to install packages. These tools do not have exact analogs on windows.

Both apt-get and yum are able to fetch files from remote (or local) repositories and use the dependency information stored in the .deb and .rpm files to fetch and install any pre-requisites not met. With these tools I do not need to know or worry about what other software I need, I can just specify apt-get install chromium and know that apt-get will make sure I have gtk+, alsa, certain X libraries, etc installed without me having to manually find and install those .deb and .rpm files.

apt-get and yum are the big two package managers, you'll also find emerge and pacman out there, which do the same jobs although with different underlying mechanisms.

5
  • 10
    +1 for talking about dependency management. This should not be overlooked.
    – user41506
    Dec 4, 2013 at 3:15
  • 1
    note: I believe .debs are packaged using the ar utility. no idea why.
    – strugee
    Dec 4, 2013 at 5:12
  • 1
    also, if you're going to count emerge as a package manager, maybe you should also consider BSD ports (although I don't know much about them, so I'm not sure if they have the equivalent of a package manager on GNU/Linux).
    – strugee
    Dec 4, 2013 at 5:14
  • 3
    @strugee true, I've edited to reflect that. Also techically, portage is package management engine behind emerge and it is very similar to ports. It is all source based and very configurable, but if a command will install/uninstall, handle dependencies and keep a database of installed packages, I'll call it a package manager. Good comments.
    – casey
    Dec 4, 2013 at 5:39
  • @casey : Where can i get more information about the underlying mechanisms of dpkg and rpm?
    – deathholes
    Dec 5, 2013 at 4:26
3

It has quite the same functionalities as an MSI file under Windows :

  • it registers the software in a registry,
  • it registers which files have been installed with that package.

Under Linux, they also manage dependencies between other packages.

This package managment formats do many other things, but this is the main functionalities.

2

.rpm files are RPM packages, which refer to the package type used by Red Hat and Red Hat-derived distros (e.g. Fedora, RHEL, CentOS). .deb files are DEB packages, which are the package type used by Debian and Debian-derivatives (e.g. Debian, Ubuntu).

When downloaded, they are typically installed via the rpm and dpkg commands respectively on the relevant distros. In other words, they are files that are installed by rpm and dpkg rather than .msi or .exe setup files which are executables that install themselves.

RPM and DEB packages differ from MSI in multiple ways.

  • As above, they are files that require other tools (i.e. rpm and dpkg) to install.
  • When installed, they are added to a database, which is not the case in MSI files. MSI files list the program in the registry, but an uninstall by Control Panel is unlikely to completely remove all installed files from disk. Thus, when RPM and DEB packages are uninstalled, all files are removed cleanly.
  • They are typically not downloaded and installed directly, but through package managers like yum and aptitude respectively - there are so-called repositories that offer packages compiled for the relevant system, and the package manager will install all dependencies automatically from data in the repositories.
  • Installed packages typically run several configuration tools, for example if you install GDM on a system already installed with LightDM, the tools ask if you would prefer to use GDM of LightDM.
  • When installing packages, other than dependencies some packages are suggested, which show packages not required but may be useful to the user.
1

Both .deb and .rpm are Software packages for GNU/Linux Distributions, containing software (program(s), application(s), etc.) and information for the "*installer *" software about the software itself and instructions about how to install what and where correctly.

  • .debDebian Software Package, on Debian (based) Distributions. Installed through e.g. apt/aptitude (Command line), or graphically via e.g. "Synaptic" "Ubuntu Software Center", "Gdebi", …
  • .rpmRed Hat Package Manager: in Fedora / Red Hat (based) Linux Distributions. Installed via e.g. yum (command line), or graphically via e.g. "yumex"
  • .msi is → Microsoft Installer: Quite the same as above, for Microsoft Windows OS

The installers themselves can also handle maintenance, updating and/or removal of packages. Also: here, "installer" means the software to accomplish this tasks correctly – it also provides the mentioned information for user itself, of course, to accomplish such tasks manually.

4
  • 1
    PackageKit isn't an application. it's an abstraction library for the different package managers across distributions.
    – strugee
    Dec 4, 2013 at 5:16
  • @strugee dang, thought this was the name. I really hope yumex is the right name… thanks for the hint
    – erch
    Dec 4, 2013 at 11:58
  • I believe the default on Fedora is GNOME Software.
    – strugee
    Dec 4, 2013 at 16:15
  • @strugee I tried Fedora for a while, used LXDE and remembered a graphical front-end for package management, but the name was… I guess, whatever works and suits one's desires best :)
    – erch
    Dec 4, 2013 at 17:00
1

.deb: Debian package used for Debian-based Linux distros such as Ubuntu, Linux Mint etc.

.rpm: rpm installer for Red Hat-based Linux distros such as RHEL, Fedora and CentOS

.msi: Binary installer for Windows platform

3
  • welcome to Stack Exchange! an explanation of why you've been downvoted: I'm not one of the two people who downvoted, but my guess is that they did so because you're implying that Debian and/or Ubuntu aren't GNU/Linuxes, and that's false. they are. (and there are a lot more distributions than just Debian, Ubuntu and Fedora.) also, you didn't really explain anything.
    – strugee
    Dec 4, 2013 at 17:09
  • 1
    Update: edited to remove that implication Dec 5, 2013 at 1:23
  • I guess the downvotes are really for just giving a one line description of what the file means, not the actual explanation of how these packages are different from each other. Have a look at the selected answer here, that is the kind of quality they expect from answers :)
    – Munim
    Dec 6, 2013 at 10:43

Not the answer you're looking for? Browse other questions tagged .