In some recent experiments with speech application Kaldi (see github) I came across an issue related to accurate determination of package manager. Compiling Kaldi depends on certain libraries and these can be determined on the local system with the proper labels, and we can get the labels via the package manager.
But which package manager? There are various: apt-get, pacman, zypper, yum, and so on. Kaldi needs to be prepared for a wide variety of possibilities.
As we know, openSUSE uses Zypper. However there is a slight twist introduced recently in Leap where a couple of packages install a version of
. It is clear that this version is not intended to be the package manager, since
returns empty. A second machine running openSUSE 12.3 does not have an apt-get so the situation would not arise.
So a simple check “does apt-get exist on the system, in which case apt-get must be the package manager” is going to lead to problems.
Is there a standard reliable way to detect that zypper is in fact the true package manager reliable across all distros?