MacPorts Cheatsheet
#
MacPorts is a package manager for macOS that simplifies the installation and management of software.
Package Management
#
Command/Option | Example | Description |
---|
port install | port install wget | Install a port/package |
port uninstall | port uninstall wget | Uninstall a port/package |
port upgrade | port upgrade outdated | Upgrade all installed ports/packages to their latest versions |
port list | port list | List all available ports/packages |
port info | port info wget | Display information about a port/package |
Searching and Ports
#
Command/Option | Example | Description |
---|
port search | port search wget | Search for a port/package |
port echo | port echo depends:curl | List ports that depend on a given port |
port installed | port installed | List all installed ports/packages |
port variants | port variants wget | Display available variants for a port/package |
Configuration and Maintenance
#
Command/Option | Example | Description |
---|
port selfupdate | port selfupdate | Update MacPorts itself |
port sync | port sync | Synchronize the port definitions with the MacPorts repository |
port clean | port clean --all | Remove old build files and unneeded files for all installed ports |
Services
#
Command/Option | Example | Description |
---|
port load | port load mysql5-server | Load a MacPorts service |
port unload | port unload mysql5-server | Unload a MacPorts service |
port restart | port restart mysql5-server | Restart a MacPorts service |
port status | port status mysql5-server | Check the status of a MacPorts service |
Additional Commands
#
Command/Option | Example | Description |
---|
port -d | port -d install wget | Run a command in debug mode |
port -v | port -v info wget | Run a command in verbose mode |
This cheatsheet covers the essential MacPorts commands and options for managing packages and services on macOS.