Skip to content

Instantly share code, notes, and snippets.

@avoidik
Last active March 31, 2024 15:33
Show Gist options
  • Save avoidik/760399e9b2d400f2903ba21ff467773d to your computer and use it in GitHub Desktop.
Save avoidik/760399e9b2d400f2903ba21ff467773d to your computer and use it in GitHub Desktop.
install macports

Install & configure Macports

This method provides an option which doesn't require sudo privileges. This will install all Macports related stuff inside of a ~/macports directory.

Install

mkdir ~/macports
cd ~/macports
curl -fsSLO https://distfiles.macports.org/MacPorts/MacPorts-2.9.1.tar.bz2
tar -zxf MacPorts-2.9.1.tar.bz2
cd MacPorts-2.9.1/
./configure --enable-readline --prefix="${HOME}/macports" --with-no-root-privileges
make
make install

Shell bash / zsh

echo 'export MACPORTS_HOME="${HOME}/macports"' >> ~/.bashrc
echo 'export PATH="${MACPORTS_HOME}/bin:${MACPORTS_HOME}/sbin"' >> ~/.bashrc

Shell 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