Marko Gresak
Marko Gresak

Reputation: 8197

Homebrew installed formulae file

I'm looking for a solution to save all installed formulae, similar to what package.json does for npm, or any other package manager with it's config file.

Is this possible with homebrew?

Upvotes: 0

Views: 108

Answers (2)

Tim Smith
Tim Smith

Reputation: 6339

There is! brew tap homebrew/brewdler and brew brewdle dump. See brew brewdle help for details.

Upvotes: 0

Mark Setchell
Mark Setchell

Reputation: 207335

I use this:

for p in $(brew list); do brew info $p; done > brewconfig.txt

If you wanted something a little more complete and legible:

#!/bin/bash
brew list > brew-packages.txt
for p in $(brew list); do
   brew list $p > brew-$p-files.txt
   brew info $p > brew-$p-config.txt
done

which gives this

-rw-r--r--  1 mark  staff      381  4 Mar 13:02 brew-wget-files.txt
-rw-r--r--  1 mark  staff      617  4 Mar 13:02 brew-wget-config.txt
-rw-r--r--  1 mark  staff      496  4 Mar 13:02 brew-zlib-files.txt
-rw-r--r--  1 mark  staff      377  4 Mar 13:02 brew-zlib-config.txt
-rw-r--r--  1 mark  staff     3849  4 Mar 13:02 brew-zeromq-files.txt
-rw-r--r--  1 mark  staff      455  4 Mar 13:02 brew-zeromq-config.txt
-rw-r--r--  1 mark  staff     4292  4 Mar 13:02 brew-xz-files.txt
-rw-r--r--  1 mark  staff      309  4 Mar 13:02 brew-xz-config.txt

Upvotes: 1

Related Questions