macOS

Where Does MacPorts Install Packages?

MacPorts lives under /opt/local with a registry DB tracking installs. The prefix layout and key files.

Last updated

MacPorts installs everything under its prefix, /opt/local by default. Ports land in libexec style subtrees below it, with binaries linked into /opt/local/bin. A custom --prefix at build time moves the whole world elsewhere.

The install ledger is a SQLite database at /opt/local/var/macports/registry/registry.db. Config sits in /opt/local/etc/macports/macports.conf with sources.conf beside it. port contents <name> lists a port's files without guessing, and port installed shows what is active.

Where MacPorts stores this, by platform

macOS
/opt/local

Prefix root for all ports. Registry DB at var/macports/registry/registry.db. Config at etc/macports/macports.conf. Needs root for installs; selfupdate refreshes the ports tree here.

Frequently asked questions

how do i list files a macports port installed

Run port contents <portname>. The registry database backs the answer, so it stays correct across upgrades. Uninstalls consult the same ledger.

can macports live somewhere besides opt local

Only via a source build with --prefix, and a single machine should keep one default prefix install. Extra instances need distinct app dirs and disabled startup items to avoid clashes.

Notice an outdated path? Let us know.