Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Is there a way to see if any installed brew package has a specific dependency?

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?

like image 615
jtlindsey Avatar asked Feb 10 '21 14:02

jtlindsey


People also ask

How do you check if a package is a 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 check dependencies installed packages in Linux?

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.

Is there a way to see dependencies in Brew?

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.

How do I find out what homebrew packages are installed?

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.

How do I know if Brew is installed or not?

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

What does the ‘brew info’ command do in Linux?

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.


1 Answers

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.
like image 89
Ortomala Lokni Avatar answered Oct 08 '22 00:10

Ortomala Lokni