How to Use MacPorts

When you or I think about software for the Mac, odds are pretty good you’re thinking about boxed software, apps available from the Mac App Store, perhaps from one of the numerous shareware websites out there. But did you know that thanks to OS X’s Darwin (BSD) roots, there is another way to try out software? On FreeBSD systems, there is a method of installing software called Ports. The idea behind Ports is very similar to the package management found on many Debian based Linux systems through apt and aptitude.

Getting geeky with it

Before getting too excited, understand the following right off the bat. First, we are going to be using something called MacPorts. The idea behind MacPorts is that you can install open source applications from the terminal window, all without any help from your browser. Cool, eh? Before getting this far however, you’ll need to install a few things though. First, you’ll want to install Xcode Tools onto your system. Once you have it installed, you then are ready to download and install MacPorts itself onto your system.

Taking MacPorts for a test drive

How to use MacPorts

Now like anything where software is being compiled, things can go wrong. If this happens, check the suggest log at the end of any presented error. Sometimes errors can be caused by a slow install and your Mac going to sleep.

Okay, so now you’re ready to get started. First go ahead and open up a Mac terminal window. Once open, type in sudo port selfupdate — that’s all, then hit the return/enter key. You will be promoted to enter in your Mac’s login password, and it will run the update. Did everything go well? Great, now let’s actually try installing software! First we need to see what’s available. To do this, we’re not going to lamely head over to some Web site. No, this is for newbies. Instead you’re going to unleash the power of the CLI and type the following in your terminal window:

port list

By typing in port list, you will then be presented with a list of available software you can install. Once you find an application you want, say something GNOME based like GRAMPS, just type the following to install it.

sudo port install gramps

After you hit Return, you’ll begin to see the system running —> Computing dependencies for gramps.

To uninstall the software, just run sudo port uninstall gramps

If you have problems, try a sudo port -nR upgrade --force gramps as an alternative.

WARNING: While the MacPorts system is pretty good, it doesn’t come without risk and should be treated as experimental, system altering software. I’ve never had serious problems with it, but I recommend that you uninstall software using the two options above just to prevent any potential problems.

Article Written by

  • http://eddieringle.com Eddie Ringle

    Technically, it’s more like Gentoo’s Portage system. It compiles software, rather than just downloading and extracting binary archives like Debian’s package system.