Server Fault is a question and answer site for system and network administrators. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I'm creating a Vagrantfile that uses chef solo to install OpenJDK on Ubuntu 12.04. Is there a way to specify which specific package of OpenJDK is installed? This way I can be sure I'm consistent across multiple installs.

share|improve this question
up vote 1 down vote accepted

You can specify the exact version number of a package as an attribute inside the package resource:

package "foo" do
  action :install
  version "1.2.3"

If the version number expected is not present in an available apt repository the recipe will fail with an exception.

share|improve this answer
Excellent, thanks! – Jeff Storey Sep 27 '12 at 1:03

Your Answer


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.