Mac OS X,  Mac OS X Server,  Mac Security

Installing and Using MacPorts

MacPorts is an application that allows you to install and remove software packages, referred to as ports (thus the name).  It’s fairly straight forward.  To get started, first download the latest version here. Once downloaded run the installer.  At the first screen, click Continue.

MacPorts Installer Welcom Screen
MacPorts Installer Welcom Screen

Next, read the ReadMe and click Continue again.

MacPorts Installer ReadMe Screen
MacPorts Installer ReadMe Screen

Next, read the license agreement at the License Agreement Screen.  Click Continue and then Agree if you agree to the license agreement.

MacPorts Installer License Agreement Screen
MacPorts Installer License Agreement Screen

Finally, choose the location of your install or just click on the Install button to install it into the standard location (/opt/local).

MacPorts Installer Location Screen
MacPorts Installer Location Screen

Once the installer is finished click on the Finish button to close out the installer.  Now cd into the /opt/local/bin directory of your system.  Here, you will find the port command.  First, let’s update the ports to the latest and greatest:

./port -d selfupdate

Now that we’ve done that we’ll be able to use port to install and uninstall packages.  To install packages:

./port install MYPACKAGE

To uninstall packages:

./port uninstall MYPACKAGE

Later, to update a package to its latest and greatest:

./port upgrade MYPACKAGE

To update all of your installed ports at once:

./port upgrade installed

To search for packages:

./port search MYSTRING (where you replace MYSTRING with the one you’d like to use)

To check dependencies:

./port deps foo

To list all the ports:

./port list

To build an actual pkg file from a port:

./port pkg MYPACKAGE

Once installed, you can also use tools such as PortAuthority to visually browse the repository and install ports.

PortAuthority
PortAuthority