Skip to content

Instantly share code, notes, and snippets.

@jorwan
Last active December 5, 2023 15:59
Show Gist options
  • Star 4 You must be signed in to star a gist
  • Fork 2 You must be signed in to fork a gist
  • Save jorwan/7912aa5095191bae23c9 to your computer and use it in GitHub Desktop.
Save jorwan/7912aa5095191bae23c9 to your computer and use it in GitHub Desktop.
MacPort Cheat Sheet

MacPort Cheat Sheet


Installing

Installing vim with macport
$ port install vim

Searching, listing, querying

List installed ports
$ port installed
List dependencies of x
$ port deps python27
List dependencies of x recursively
$ port rdeps python27
List ports that depend on x
$ port dependents python27
Show the list of files in a port
$ port contents python27
Tells important information concerning setup and use of the port, for example that in order to set a python flavor to be default you have to do this step manually:
$ sudo port select --set python python27
$ port notes python27
Shows available versions and the currently active version of a package ( port select virtualenv virtualenv27 )
$ port select virtualenv

Dry run

Dry run, works with all commands, shows what would be done
$ port -y install python27

Uninstalling

Uninstall package and all other ports that depend on it
$ sudo port uninstall --follow-dependents python27
Uninstall all installed versions (active or inactive) of a port
$ sudo port uninstall python27 and installed
Uninstall all installed versions of python27, py27-pip and all installed versions of gtk2
$ sudo port uninstall python27 and installed py27-pip gtk2 and installed
Uninstall all inactive (~outdated) ports
$ sudo port -u uninstall

Upgrading

Update the ports database
$ sudo port selfupdate
Upgrade all outdated ports (WARNING: this can take a long time, be near power source!)
$ sudo port upgrade outdated

Misc

/opt/local/etc/macports/variants.conf
$ locate variants.conf
/opt/local/etc/macports/macports.conf
$ locate macports.conf

Information taken from: Wiki Titan2x

More information in: Trac Mac Ports

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment