That’s because it might also compile from source. But I’m not going to compile; I’m going to install from distro packages.

How do I “override” this depends for my environment? I could of course clone or fork the cookbook and modify the metadata.rb, but doing so, I’ll lose the ability to easily get the changes, that might be done in future to the cookbook.

Perhaps not exactly what you’re looking for, but you can override the cookbook for your entire organization by uploading a blank cookbook named ‘build-essential’ to your chef server. I’ve heard of of people doing this for this exact cookbook to avoid getting build tools on their servers.

To limit by environment, all I can think of is to give this blank cookbook a version number like ‘0.0.999’ and then pin this version (the real build-essential is on version 8 now). Admittedly though this makes the original hack even hackier…

You should only really need to do this if the community cookbook is calling the default recipe of build-essential and installing tools you don’t want, or you want to make sure no one else in your organization uses this cookbook if you have a policy against it or something. If it’s just coming across as a dependency but not getting called it won’t do anything.