Skip to content

Instantly share code, notes, and snippets.

@lukmdo
Last active December 26, 2015 20:49
Show Gist options
  • Save lukmdo/7212129 to your computer and use it in GitHub Desktop.
Save lukmdo/7212129 to your computer and use it in GitHub Desktop.
MacPorts Upgrade Procedure

MacPorts Upgrade Procedure - more

Save the list of installed ports:
port -qv installed > myports.txt
Uninstall all installed ports:
sudo port -f uninstall installed
Clean any partially-completed builds:
sudo port clean all
Get fresh MacPorts-X.Y.Z
curl -O https://distfiles.macports.org/MacPorts/MacPorts-X.Y.Z.tar.bz2
tar xf MacPorts-X.Y.Z.tar.bz2
Build and install
cd MacPorts-X.Y.Z/
./configure
make
sudo make install
Sanity check your fresh base MacPorts
sudo port selfupdate
Edit myports.txt and leave only the lines you need
mate myports.txt     
awk '{print $1}' myports.txt | sort > myports.txt
sudo port install `cat myports.txt tr '\n' ' '`
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment