Take the 2-minute tour ×
Server Fault is a question and answer site for system and network administrators. It's 100% free, no registration required.

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?

share|improve this question
    
Well, I eventually got there. The most painful differences were subtle - like the absence of an Ident server. –  Steve Bennett Jul 11 '12 at 7:59

1 Answer 1

up vote 2 down vote accepted

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).

share|improve this answer
    
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 4 '12 at 5:45
    
Assume all packages are, and get going with apt-cache search [--names-only], apt-cache show! –  Pierre Carrier Jul 4 '12 at 5:54

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

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