Body
Summary
How to set user environment settings for MacPorts.
If the MacPorts install was performed as someone other than the end user, we’ll need to update their PATH environment variable.
Environment
This is a follow-up step if MacPorts did not return a path of /opt/local/bin/port to the query which port
in Terminal.
Directions
- Log into the computer with a local admin account.
- Open Terminal.
- Acquire a super-user shell by typing the following command:
sudo -s
- Navigate to the user’s home directory:
cd /Users/uniqname
- Open the user’s .bash_profile for editing with your preferred editor, for example one of these:
nano .bash_profile
vim .bash_profile
- Add a path entry to the bottom of the .bash_profile file, by pasting in the following:
export PATH="/opt/local/bin:/opt/local/sbin:$PATH"
- Exit from the editor and save your changes.
- Exit from the admin shell.