>Instead you can write a block of code with Chef, for example, that abstracts away the differences between distributions. You can execute this same Chef recipe and it will work anywhere that a libxml2 package exists.
But this doesn't really work. What if the package is differently named on different distributions? What if one distribution's version of the package isn't compatible with your use of it? Besides, how often do you switch between distributions on your servers?
> What if the package is differently named on different distributions?
You write a case/when block that chooses the right name.
> What if one distribution's version of the package isn't compatible with your use of it?
Rarely happens, but then you just compile/package your own. Or solve the incompatibility from the other side.
> Besides, how often do you switch between distributions on your servers?
Rarely. More often you want to reuse configuration management code from a common repository which installs X, but abstracts the distro differences because many people collaborated on it. Also, often you're running multiple distros within the same company but it helps to have the same deploy/management process.
> You write a case/when block that chooses the right name.
I think this starts to get to the heart of the issue. This is why Configuration Mangement gets so complex - because your CM scripts need all of this special purpose logic to work around these kinds of environmental differences.
The CM scripts become their own source of complexity.
Abstract / concrete is a spectrum ;) It abstracts over all the things which are standardised, known ahead of time, and known at the time of writing the system. Things that people just come up with are always going to be unstable.
It's not that big of an issue in practice though. About the only package I can remember out of under a hundred I dealt with was mysqld/mysql-server. Names match up in almost every case, especially on user-facing things (less on -dev/-devel and similar ones)
But this doesn't really work. What if the package is differently named on different distributions? What if one distribution's version of the package isn't compatible with your use of it? Besides, how often do you switch between distributions on your servers?