Switch from MacPorts to HomeBrew

Homebrew appears to be a nice replacement for MacPorts for installing unix applications not provided by Apple. It puts installed libraries in their own folders in /usr/local/Cellar/ and then sym-links the executables to /usr/local/bin/. It also appears to provide a nice way of keeping Python 2.X up-to-date, but I haven’t tried that yet.

Install Homebrew:

/usr/bin/ruby -e "$(/usr/bin/curl -fksSL https://raw.github.com/mxcl/homebrew/master/Library/Contributions/install_homebrew.rb)"

To remove the installed macports, I first just mv the macports directory to a dummy name so that the macports won’t be found in the PATH but that they can easily be reinstated if any problems with homebrew arise:

sudo mv /opt/local /opt/local_macports

If you used the “tar” trick described below to install replace the Mac tar, you need to first revert to the old tar and then use homebrew to re-install gnu-tar:

sudo ln -sf /usr/bin/mactar /usr/bin/tar
brew install gnu-tar
sudo ln -sf /usr/local/bin/gtar /usr/bin/tar

Some useful initial homebrew libraries:

brew install wget
brew install imagemagick
brew install fftw
brew install cfitsio
brew install gnuplot
This entry was posted in install, Tips and tagged , . Bookmark the permalink.

6 Responses to Switch from MacPorts to HomeBrew

  1. verdiergun says:

    sudo mv /opt/local ~/macports I typed the command in terminal after installing homebrew and now passenger no longer works and port no longer works in terminal. I am having trouble restoring macports to how it was to do a proper uninstallation.


    Any advice?

    • gbb says:

      The “port” executable lives in /opt/local/bin so if you move /opt/local so it’s no longer in your $PATH, port won’t be found. For “port uninstall” to work, I’m sure that it has to be able to find things in /opt/local, so perhaps try moving ~/macports back to /opt/local and the follow the (more detailed and complete) instructions from the bitboxer.de link.


  2. verdiergun says:

    I’m adding a comment to be notified via e-mail. I’ll receive an update when the thread is responded to.

  3. manana says:

    Are HomeBrew packages pre-compiled?

  4. Pingback: Going from MacPorts to Homebrew

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s