Skip to content

Instantly share code, notes, and snippets.

@daggerok
Last active August 18, 2025 16:46
Show Gist options
  • Save daggerok/d6c7ed8b9efa03b30ffd0e9f44cdd121 to your computer and use it in GitHub Desktop.
Save daggerok/d6c7ed8b9efa03b30ffd0e9f44cdd121 to your computer and use it in GitHub Desktop.
Install MacPorts 2.5.3 without sudo / root privileges
# install
mkdir ~/macports
cd ~/macports
curl -O https://distfiles.macports.org/MacPorts/MacPorts-2.5.3.tar.bz2
tar xf MacPorts-2.5.3.tar.bz2
cd MacPorts-2.5.3/
./configure --enable-readline --prefix=$HOME/macports --with-no-root-privileges
make && make install
# bash / zsh
echo "export MACPORTS_HOME=\\$HOME/macports" >> ~/.bash_profile
echo "export PATH=\\$MACPORTS_HOME/bin:\\$MACPORTS_HOME/sbin" >> ~/.bash_profile
# fish
echo "set -gx MACPORTS_HOME \\$HOME/macports" >> ~/.config/fish/config.fish
echo "set -gx PATH $MACPORTS_HOME/bin $MACPORTS_HOME/sbin" >> ~/.config/fish/config.fish
@panoriega
Copy link

panoriega commented Aug 18, 2025

mkdir ~/macports
cd ~/macports
curl -O https://distfiles.macports.org/MacPorts/MacPorts-2.11.4.tar.bz2
tar xf MacPorts-2.11.4.tar.bz2
cd MacPorts-2.11.4/

./configure --enable-readline --prefix=$HOME/macports --with-no-root-privileges
make && make install

# bash / zsh
echo "export MACPORTS_HOME=\$HOME/macports" >> ~/.bash_profile
echo "export PATH=\$PATH:\$MACPORTS_HOME/bin:\$MACPORTS_HOME/sbin" >> ~/.bash_profile

# fish
mkdir ~/.config/fish
echo "set -gx MACPORTS_HOME \\$HOME/macports" >> ~/.config/fish/config.fish
echo "set -gx PATH $MACPORTS_HOME/bin $MACPORTS_HOME/sbin" >> ~/.config/fish/config.fish

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