Skip to content

Instantly share code, notes, and snippets.

@deepak-kosaraju
Created June 4, 2014 05:41
Show Gist options
  • Save deepak-kosaraju/8bad34db4a0b9be06410 to your computer and use it in GitHub Desktop.
Save deepak-kosaraju/8bad34db4a0b9be06410 to your computer and use it in GitHub Desktop.
MacPorts Update/Upgrade Tips
Mac Ports Maintenance:
# sync the porttree
sudo -s -- 'port -d sync && port -d selfupdate && port outdated && port -u upgrade outdated'
#To uninstall all the in-active ports
for i in "`port installed|grep -v active| awk -F' ' {'print $1" " $2'}|sed '/The following/d'`";do echo "$i";sudo port -u uninstall $i;done
# To remove source and install logs of active ports
for i in "`port installed| awk -F' ' {'print $1" " $2'}|sed '/The following/d'`";do echo "$i";sudo port clean --dist --logs $i;done
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment