Does Homebrew keep a log of installed packages/casks?

Viewed 400

Anyone know if Homebrew keeps a log of previously-installed packages? I know I can do a brew list, but that shows all packages and their dependencies ... I was hoping instead to just see the explicitly-requested packages (i.e. not with the implicitly-installed dependencies).

2 Answers

Homebrew doesn’t have a global log, but it does keep that information at the formula level:

$ brew info --json=v1 git | jq '.[0].installed[0]|{installed_on_request,installed_as_dependency}'    
{
  "installed_on_request": true,
  "installed_as_dependency": false
}

With a bit of jq you can get the full list of formulae installed on request. It’s slow because it needs to load every single formula’s JSON payload, but it works:

brew info --json=v1 --installed | jq -r '.[]|select(.installed[0].installed_on_request).full_name'
Related