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?
You can use the apt show command to display details of a package. Part of this information is dependencies and you can see it in the line starting with Depends.
How Do I Check Dependencies for Specific Packages? Use the 'showpkg' sub command to check the dependencies for particular software packages. whether those dependencies packages are installed or not. For example, use the 'showpkg' command along with package-name.
I found the brew deps --tree switch is also very helpful to visualize dependencies just in the command line. From the official doc: brew deps --tree [--1] [filters] [--annotate] (formulae|--installed): Show dependencies as a tree.
The first approach uses a simple search command: The output of ‘brew search’ will be every available Homebrew package that could be installed. Or you can browse the brew formula page here for a full list of Homebrew packages that could theoretically be installed.
The standard way of figuring out if Homebrew is installed is by using the “which” command An alternative method to determining if brew is installed is to use the command below. This “command -v brew” will output nothing if Homebrew is not installed
Nonetheless the full ‘brew info’ command output is incredibly useful to get extensive information about any installed package and it has obvious value for that reason, in addition to showing where something is installed. Try these commands yourself with any Homebrew package.
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.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With