Category Archives: Homebrew

Back up (Migrate) Homebrew Packages

Last updated on October 9, 2016

As one of the most popular package manager on OS X, Homebrew is indeed a very nice tool to manage packages. However, when you want to back up your packages, or migrate the packages onto another machine, Homebrew didn’t invent such a tool. If you are moving to an OS X of the same version, you can simply copy the Homebrew directory (default is /usr/local) to your new machine. Otherwise, we need to find a way to install the exactly same packages on your new machine. In order to accomplish the goal, I wrote a small piece of bash script to generate a restore script to install the packages.

Continue reading

Use Both Homebrew and Macports on Your OS X

Last updated on October 1, 2016

Homebrew and Macports are two excellent package managers on OS X. At most of the time, Homebrew is fair enough: it has a large package collections. But sometimes, there are just some packages not available in Homebrew while they are in Macports. Although having both of them installed is not recommended, I still want to give it a try.

The basic rules here are using Homebrew packages as much as possible. When one package is not available in Homebrew, install it from Macports (you will soon see why). We will wrap the executables installed by Macports with suitable Environmental Variables.

Please note that this post only presents a workaround. It is not garanteed to work, and it is possible that it does not work under some certain circumstances.

Continue reading