Page History


Nigel Stanger edited this page on 14 Sep 2021

Clone this wiki locally

Useful subcommands and options

  • --no-rev-upgrade prevents the check for broken packages.
  • --enforce-variants forces package upgrade even if the variants are different.
  • To set the DPI for MacPorts defaults write org.macports.X11 dpi -int <n>, where <n> is the system-reported DPI (double it for Retina displays). For example, a 27-inch 5K (Retina) iMac reports 108 DPI, so set it to 216. You can find the system-reported DPI in the Adobe Reader preferences under Page Display. (

Upgrade a specific subset of outdated ports

For example, upgrade just the Python 3.9 modules:

port outdated | grep py39- | awk '{print $1}' | xargs sudo port upgrade --no-rev-upgrade

Reclaim space

This is pretty much now superseded by port reclaim.

To clean up all old installed but inactive versions of packages: sudo port uninstall inactive

To clean out old versions of distfiles (especially for active ports):

sudo rm /opt/local/var/macports/distfiles_mirror.db
sudo rm /opt/local/var/macports/distfiles_mirror.db.lock
sudo port -p mirror installed
sudo portmirror