Skip to content

Instantly share code, notes, and snippets.

@fbrnc
Created August 13, 2014 03:27
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save fbrnc/8ed33626f2fdeb4507df to your computer and use it in GitHub Desktop.
Save fbrnc/8ed33626f2fdeb4507df to your computer and use it in GitHub Desktop.
Install Chef and Berkshelf on Ubuntu
#!/bin/bash
apt-get -y update
apt-get -y install build-essential ruby-dev git curl build-essential libxml2-dev libxslt-dev libssl-dev autoconf
if [ ! -e /opt/chef/bin/chef-solo ] ; then
curl -L https://www.opscode.com/chef/install.sh | bash
fi
if [ ! -e /opt/chef/embedded/bin/berks ] ; then
/opt/chef/embedded/bin/gem install berkshelf --no-ri --no-rdoc
ln -s /opt/chef/embedded/bin/berks /usr/local/bin/berks
fi
@dragon788
Copy link

Thanks for this. Was looking for a way to test/deploy simple workstation setup scripts without installing the whole ChefDK and this does the trick. I think the last symlink may be unnecessary as if you sudo gem install berkshelf it gets put in /usr/local/bin/berks already (maybe came in a version after you wrote this though).

Not sure how much space is saved vs the ChefDK, I need to compare them at some point because with the ruby-dev packages and 58 gems installed with berkshelf I'm not sure if it saves any time/space.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment