Is it possible to build a Linux distro supporting both RPM and .deb packages?
I didn’t think there are any distributions out there which support both natively, but it turns out there is one in development, Bedrock Linux (thanks to iMalinowski for the information). On other distributions you can use conversion tools such as alien
to convert from one format to the other. Anything software-based is doable, given enough time and energy, so it would be possible to build such a distribution (but given the differences between the capabilities of .deb
and .rpm
packages, quite difficult).
However all this probably stems from the idea that supporting both package formats would make life simpler, because you could then install packages from anywhere (well, anywhere providing a .deb
or .rpm
). Philosophically, that’s flawed. A distribution is a coherent set of packages; if you want to provide software for that distribution, you really need to target it specifically, which includes using its package format (and more importantly, metadata). There’s no point in supporting multiple package formats natively.
(In the Debian world, packages can work on variants which aren’t their main target, because the package nomenclature is rather homogeneous, and because most distributions fit in an inheritance tree. That’s not true in the RPM world. In both cases mixing and matching is a bad idea.)
You should consider your distribution as a base on which to build your desired system, sticking to your distribution’s rules and ecosystem, without mixing things in from other distributions. You need higher-level abstractions to support mixing and matching (or rather, to provide cross-distribution environments): the Steam runtime, Flatpak, etc.
Bedrock Linux does this. Not saying I've done this, or that it is a good idea, but it is being done.
No, such a monster should not be built. Unlike, say, an MacOS application bundle, which typically includes everything the application needs to run on the operating system, RPM and .deb packages are almost always dependent on other packages, such as shared libraries. Linux packages list the other packages that need to be present, and the package manager helps enforce those requirements. Furthermore, Linux distributions differ in the way things are done (e.g. /etc/network/interfaces.d
vs. /etc/sysconfig/network-scripts
).
You shouldn't even mix packages from arbitrary repositories within the same package format family. That is, installing SuSE packages on a CentOS machine is just asking for trouble, even though they both use RPM. I wouldn't even install packages intended for a different version of the same OS (e.g. Ubuntu 14.04 packages on a 16.04 system) unless I knew exactly what I was doing.
So, trying to support both RPM and .deb on the same system is out of the question. In certain desperate situations, you could convert specific packages using alien
, but you should expect to put a lot of effort into troubleshooting problems that would inevitably arise from such hacks.