macosmacports

MacOS MacPorts: how to install on multi user machine


I am setting up a Mac and want to use MacPorts to install software. Ideally I have one admin user to install software and another normal user just to use that software. Installed MacPorts with my admin user (using the pkg file) and a package (ffmpeg7).. but when log in with the normal user I can't access MacPorts nor the package.

I get:

zsh: command not found: port

is this normal? I would like to install packages for all users (Browser etc).


Solution

  • The MacPorts installer only modifies the Shell environment of the installing user. If you're on a multi-user system, you'll have to add /opt/local/bin to your users' $PATH environment variable.

    If you want to do that centrally for all users, you can edit /etc/zshrc or /etc/paths. Note that adding a file into /etc/paths.d (advice you may find in other places) will always append MacPorts' path, not prepend. Typically you'd prefer MacPorts-installed tools over the ones shipped by Apple in /usr, so appending isn't very helpful in this case.

    For more information see the section "MacPorts and the Shell" in the guide at https://guide.macports.org/#installing.shell.