I'm trying to write a general purpose script which at one point attempts to install certain packages on Linux systems. To handle the different package managers across various distros, I am using pacapt (https://github.com/icy/pacapt).

However, pacapt does not seem to perform package name translation. Packages have different naming conventions across distros, and hence I can't write a single command to install the packages on different types of systems. Is there any utility / webservice / list that I can use to translate package names from one distro to another?

  • 1
    It's worse than that! A package (e.g. perl) is not the same thing, as certain vendors who shall remain unnamed split the standard perl release up into various random packages. So you may also need to map a package on one system to groups of packages on another for the same set of files to be installed. – thrig Apr 8 '16 at 18:10
  • True. Though I just concede, I hadn't thought of that. Yet, if one were to maintain such a list, handling groups shouldn't be too hard – darnir Apr 8 '16 at 18:15
  • So how did you end up solving that problem, Darnir? I have it now :) and realized pacapt didnt solve it. Now, i'm tempted to have a config file that would have package names for every distro..of only the packages I use. – madCode Nov 10 '16 at 22:35
  • I didn't solve it. Instead like you said, I maintain a list of packages I want across the distros I care about. But a solution based on what Gilles said should be possible to write – darnir Nov 12 '16 at 14:08

Different distributions have not only different package names, but also different ways of breaking packages down. I think your best bet is to define dependencies in terms of files rather than in terms of packages. For example, if you need perl, record that you want /usr/bin/perl, not perl.

Unfortunately, from a cursory look, pacapt doesn't seem to support querying which package provides a given file (-Qo only queries installed packages, not available packages). This would be a worthwhile feature to add. I'm not aware of any similar tool to do it; with some distributions, it might be difficult, as they don't all provide this information in a reasonable form (for example, on Debian, there's apt-file, but some derivatives don't provide the corresponding database). The Pacman Rosetta lists the commands to use (pkgfile on Arch).

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.