33

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?

2
  • 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
    Commented Feb 10, 2021 at 15:08
  • Thank you @axiac ! It checks casks too and that with wc gives me the total. brew uses --recursive java | wc -l
    – jtlindsey
    Commented Feb 10, 2021 at 16:55

1 Answer 1

63

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.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.