Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to migrate a Homebrew environment to another computer?

Tags:

homebrew

What is the preferred method of exporting a homebrew environment so I can synchronize my workspace between computers? Seems like there should be something similar to composer.lock or pip freeze. Is there a better way than brew list > brews.txt?

like image 514
joemaller Avatar asked Dec 31 '12 17:12

joemaller


2 Answers

There is a better way: brew leaves.

This command prints a simple list of installed formulae which are not dependencies of any other formulae. Essentially this lists everything that was manually installed or is a leftover dependency from a removed formula.

$ brew leaves
apple-gcc42
bash-completion
brew-cask
git
[...]

There's no built-in means of using brew leaves output to install, but just having a clean list of manually-installed formulae is a step in the right direction.

Thanks to this Gabe Berke-Williams for writing about this: http://robots.thoughtbot.com/brew-leaves

like image 137
joemaller Avatar answered Oct 01 '22 17:10

joemaller


Homebrew Bundle seems like a pretty great solution.

like image 28
Asbjørn Ulsberg Avatar answered Oct 01 '22 17:10

Asbjørn Ulsberg