Child pages
  • Installing, Upgrading, and Uninstalling Macports

Versions Compared


  • This line was added.
  • This line was removed.
  • Formatting was changed.

What is Macports?

  • Macports is a software repository that ports Linux open-source software to be compatible with Macs.
  • Examples of such software are gmt, nedit, ghostscript and gv.

Installing Macports on your Mac will allow you to have access to their repository and install ported Linux tools. You can also update any Macports software you installed via the appropriate port command.

Do I Need Macports?

  • Macports is installed on every managed machine at IGPP.
  • If you have a self-managed machine and need software like gmt, nedit, gv, etc. then you should follow this wiki.

Macports at IGPP

Below is a list of ports that are installed on every managed IGPP computer:


A comprehensive list of available ports can be found at

Prerequisite: Install Xcode and Xcode Command Line Tools

  1. A wiki on installing Xcode via the App Store can be found here: Installing Xcode Tools and X11
  2. Prior to running these commands you should have:
  3. Installed Xcode
  4. Installed Xcode Command Line Tools.

    Code Block
    sudo xcode-select --install 
    sudo xcodebuild -license (type "agree" to accept license).
    open /Library/Developer/CommandLineTools/Packages/macOS_SDK_headers_for_macOS_10.14.pkg (10.14 and later)


export PATH=/opt/local/bin:/opt/local/sbin:$PATH

This is automatically done for you when you install Macports.

However, gmt4 is installed in /opt/local/lib/gmt4/. Since this path isn't installed by default, you must manually create it in your ~/.profile so your computer knows where to look for it.

Upgrading Macports

These commands would be done if you wanted to keep your installed ports updated to the latest version.

  1. sudo port selfupdate
  2. sudo port upgrade installed

Macports Cheat Sheet

Macports must be installed for the port command to work. 


port command


sudo port selfupdate

Sync local tree with Macports repository. Do this before installing or upgrading ports.

sudo port install [port]

Install ports

sudo port upgrade installed

Upgrade installed ports

Uninstalling Macports


Official documentation can be found at