Updating a Chef tool-chain installation
... describes how to upgrade and downgrade chef-solo and friends.
Updating the Chef client tool-chain is simple and low-risk. Updating Chef Server is potentially more involved (and is not covered by this HOW-TO at the moment.)
Assuming that you are using the "Omnibus Chef" installation procedure, an installation of the Chef tool-chain lives in the "/opt/chef" directory. If you want to preserve a copy of your current installation, either "move" it, or take a copy of the tree.
Updating the Chef tool-chain
It is as simple as re-running the step that installed the chef tools in the first place; e.g.
sudo bash -c "curl -L https://www.opscode.com/chef/install.sh | bash"
This will install the latest stable release on top of your existing Chef tools in "/opt/chef". My experience is that if you have Berkshelf installed in "/opt/chef", the reinstall won't affect it. However, if it does you should simply be able to reinstall that as well using the same procedure as you used in the first place.
Finally, if something does go wrong, you can always delete the '/opt/chef' tree and start again. There should be no Chef state in the "/opt/chef" directory.
Downgrading the Chef tool-chain
It has been known for the Opscode team to push a new version of the Chef tool-chain with a show-stopper bug in it. (Or at least, a tool with some change that causes your existing recipes to fail. The problem may be in the recipes ...)
If you need to downgrade Chefv, or indeed if you just want to control the version of Chef that you install, then the procedure is a little more involved than the "one-liner" above.
- Download the "install.sh" to a local file:
curl https://www.opscode.com/chef/install.sh > install.sh
- Make the script executable:
chmod 755 install.sh
- Run the command using the -v option to select the Chef tool-chain version you want to install:
./install.sh -v <version>
The "<version>" above needs to match a Chef version for which Opscode provide an omnibus installer build for your platform. It typically looks like "nn.nn" or "nn.nn.nn". If you pick a version that is not recognized, the script will fail quickly. (If find find a page that lists the Chef versions, please let me know so that I can link to it!)
It is possible to build your own omnibus installers or install Chef in other ways, but that is beyond the scope of these instructions.