问题描述
This similar question 和 this one 提供信息,如果您想列出所有包依赖项并手动检查每个依赖项。在我的系统上,一些包有超过 30 个依赖项。我正在检查每个已安装的软件包,试图找出哪个软件包具有 Java 依赖项。
我试图以一种方式查看所有已安装的软件包,包括那些与 cask 一起安装的软件包。有没有办法查看任何已安装的 brew 包是否具有特定的依赖关系?
解决方法
要根据 java 包使用查看所有已安装的包:
brew uses --recursive --installed java
根据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.