Search code examples
rubyvagrantchef-infrachef-recipechef-solo

Cookbook apt not found


I have been trying to run my cookbooks from many hours and gone through multiple questions regarding the same but still couldn't manage to make it work.

sudo chef-solo -c solo.rb -j node.json -o main::default;

I'm running the above command inside my cookbooks folder which contains other cookbooks like apt, git, etc.

And, inside cookbooks/main/recipe/default.rb I'm including include_recipe "apt".

Every time, I run the command I get the following error:

Cookbook apt not found. If you're loading apt from another cookbook, make sure you configure the dependency in your metadata

So I added depends "apt" inside my cookbooks/main/metadata.rb. But now I'm getting this error:

Cookbook depends on itself in cookbook apt, please remove this unnecessary self-dependency


Solution

  • A second answer because this was diagnosed on Slack, themain cookbook had name "apt" in its metadata which made the error message confusing.