Install Chef 10 Client on Debian

The installation is very similar to the server installation, with a few differences. For the server installation have a look here.

First of all add the Opscode repository to apt: 
echo "deb `lsb_release -cs`-0.10 main" | tee /etc/apt/sources.list.d/opscode.list
lsb_release -cs will correspond to the name if your release (put in "squeeze" or "wheezy" instead for example if you do not have the lsb package installed).

On Debian Wheezy you should also omit the "-0.10", I've encountered some bugs when installing chef on Wheezy:
1. You should comment squeeze-backports in /etc/apt/sources.list and check if there are none in /etc/apt/sources.list.d/
2.  apt-get -y remove ruby* ohai* && aptitude install ruby1.8 rubygems
For the rest of the installation it's the same procedure!

Then add the GPG key:
mkdir -p /etc/apt/trusted.gpg.d
gpg −−keyserver −−recv-keys 83EF826A
gpg −−export | tee /etc/apt/trusted.gpg.d/opscode-keyring.gpg > /dev/null

Then install the Chef Client:
apt-get update
apt-get upgrade
apt-get install opscode-keyring
apt-get install chef

While the installation you're asked to enter the URL of your Chef server, just enter http://<your-ip-address>:4000 putting in the IP address of your machine:

Screenshot 1


Now you need to copy the certificate from the server and restart the client:
scp -v root@<ip-of-your-server>:/etc/chef/validation.pem /etc/chef/
/etc/init.d/chef-client restart

Then just execute the client command: chef-client
Depending if you already have added something to your run list, you might see semething like:

Screenshot 1