Reliable way to determine native packaging system

Theodore Papadopoulo Theodore.Papadopoulo at
Fri Mar 15 17:56:20 UTC 2013

Hash: SHA1

On 03/14/2013 11:33 PM, Mateusz Marzantowicz wrote:
> On 14.03.2013 19:25, Theodore Papadopoulo wrote:
>> Yes I imagined that detecting /var/lib/rpm was one way to deal
>> with the problem (but not /etc/*-release as this is exactly what
>> I want to avoid: having to map distributions to packaging
>> system).
> Maybe you have your reasons that I don't understand but package 
> management is distribution related. Generally Linux distributions
> are built around package managers. There are rpm based ones like
> Fedora, RH, SuSE and deb based like Debian, Ubuntu. There is opkg
> in OpenWRT and something that I can't remember right now in Arch.
> So package management is tightly related to Linux distro. Detecting
> Linux distribution is easier than searching for rpm or dpkg
> commands and checking if they are dominant package managers on the
> system.
> Mateusz Marzantowicz

Simply go to:

and see the number of distributions. There are far fewer packaging
systems than distributions, and I clearly do not want to maintain a
map distribution -> packaging system.

I know that these packaging systems are differing in details (for rpm,
Suse and Fedora/Redhat macros are not the same), but if I can provide
a spec that relies on the common denominator, it would build a package
for any rpm based distrib without me even knowing that this
distribution exists.

So there is an advantage in having a reliable way to get this
information, otherwise I will do something heuristicL that works
sometimes.... and I like when I write the code once and then can
forget it forever because it just works ;-)

OK I know this will never be the case, but if I can convince
distribs/people to provide such a facility, the gnu/linux world will
be infinitesimally better I think...

And it seems that the cost of adding some script (with a common name)
or adding an option (eg in lsb_release) is not very high. The more
difficult step is to convince everyone and to get some consensus...
Bit again, this seems so trixial, so that I cannot see people arguing
the pros and cons forever. They will find it's a good or a bad idea.
The time spent to discuss this is probably already much higher than
the time needed to implement sthg simple.

Version: GnuPG v1.4.13 (GNU/Linux)
Comment: Using GnuPG with Thunderbird -


More information about the users mailing list