0

I'm trying to adapt a chef recipe developed for Centos to Ubuntu, and thinking that there must be a better way.

Methodology (I'm using Vagrant):

  • vagrant reload
  • Look through log to find the package that broke

Example:

[Wed, 04 Jul 2012 06:24:34 +0200] FATAL: Chef::Exceptions::Package: package[python-devel] (foo::deps line 57) had an error: Chef::Exceptions::Package: No version specified, and no candidate version available for python-devel
  • Google "apt-get install " to try to find the Ubuntu equivalent
  • Modify the code to include a platform test, using the package name I've discovered.
  • Repeat.

Is there a quick and reliable way to find the Ubuntu (apt-get instead of yum) package name from the Centos one? Something else I'm missing?

Steve Bennett
  • 5,539
  • 12
  • 45
  • 57

1 Answers1

2

There is no list of 1-to-1 package equivalencies between distros, because there is no 1-to-1 equivalence, and even if there was, it changes on a regular basis as packaging evolves.

The quick and reliable way I use is experience -- deep knowledge of the way Debian packages work is usually enough to tell me what the package name will be (with perhaps a quick apt-cache search to confirm my suspicion). I think you're doing the whole conversion spectacularly inefficiently, though -- rather than playing whack-a-mole with a lengthy turnaround after each whack, you'd be better served reading through the entire recipe at once, looking at all the packages (and everything else, like file locations) and translating from CentOS to Ubuntu as you go. There might be one or two things you'll have to fix up that you missed, but that'll be a lot quicker than finding every single thing that needs changing one at a time -- and you'll pick up things that Chef won't error out on at all (like the aforementioned file locations problem).

womble
  • 95,029
  • 29
  • 173
  • 228
  • Love the whack-a-mole analogy. Point taken, though unfortunately I don't have sufficient knowledge of either distribution to readily spot differences. – Steve Bennett Jul 04 '12 at 05:45
  • Assume all packages are, and get going with `apt-cache search [--names-only]`, `apt-cache show`! – Pierre Carrier Jul 04 '12 at 05:54