Installing packages from a third-party repository
Even though the Ubuntu package repository contains many up-to-date packages, you might encounter situations in which the package you need is either missing or outdated. In such cases, you can either use third-party repositories or your own repositories (containing self-made packages). Chef makes it simple to use additional APT repositories with the apt
cookbook.
Getting ready
Make sure that you have a cookbook called my_cookbook
and that the run_list
of your node includes my_cookbook
, as described in the Creating and using cookbooks recipe in Chapter 1, Chef Infrastructure.
Let's retrieve the required apt
cookbook:
Add it to
Berksfile
:mma@laptop:~/chef-repo $ subl Berksfile source 'https://supermarket.getchef.com' cookbook 'my_cookbook', path: './cookbooks/my_cookbook' cookbook 'apt','~> 5.0.0'
Install it to your local workstation:
mma@laptop:~/chef-repo $ berks install Resolving cookbook dependencies... Fetching cookbook index from https...