Installing MacPorts on your Mac

What is MacPorts?

MacPorts provides an infrastructure for building, installing, and packaging open source software. It is designed to match the functionality of the FreeBSD Ports system and to be extensible for future enhancements.

Installing MacPorts

Download the macports package for your version here or you can click on the version of the MacOS you have here: Mountain LionLionSnow Leopard orLeopard. Double click on the package to run the Installer and follow the on-screen instructions until completion.

Basic Usage

The main user interface to MacPorts is the port command and the various facilities it provides for installing ports. The first thing you should do after you install MacPorts is to make sure it is fully up to date by pulling the latest revisions to the Portfiles and any updated MacPorts base code from our rsync server, all accomplished simply by running the port selfupdate command as the Unix superuser:

1
sudo port selfupdate

Running this command on a regular basis is recommended — it ensures your MacPorts installation is always up to date. Afterwards, you may search for ports to install:

1
port search <portname>

where is the name of the port you are searching for, or a partial name. To install a port you’ve chosen, you need to run the port install command as the Unix superuser:

1
sudo port install <portname>

where now maps to an exact port name in the ports tree, such as those returned by the port search command. Please consult the port(1) man page for complete documentation for this command and the software installation process.