5
votes

This similar question and this one provides info if you want to list all package dependencies and manually go through each one. On my system some packages have over 30 dependencies. I'm going through each installed package trying to find which one if any have a java dependency.

I'm trying to look in a fashion that will look at all installed packages including those installed with cask. Is there a way to see if any installed brew package has a specific dependency?

1
Try brew uses --recursive java. Type brew help uses on your terminal to find what other options you can put in the command line if it does not produce any output.axiac
Thank you @axiac ! It checks casks too and that with wc gives me the total. brew uses --recursive java | wc -ljtlindsey

1 Answers

6
votes

To see all installed packages depending on the java package use:

brew uses --recursive --installed java

Accoring to man brew:

uses [options] formula [...]
   Show  formulae  and  casks that specify formula as a dependency; that is, show dependents of formula. When given multiple formula argu-
   ments, show the intersection of formulae that use formula. By default, uses shows all formulae and casks  that  specify  formula  as a
   required or recommended dependency for their stable builds.

   --recursive
          Resolve more than one level of dependencies.

   --installed
          Only list formulae and casks that are currently installed.