Last active
December 21, 2015 22:09
-
-
Save huwr/6373219 to your computer and use it in GitHub Desktop.
Cleans away old Mac Ports
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash -v | |
# | |
# clean old mac ports. Can save a few GBs. | |
# run as root. | |
echo "Before: " | |
du -sh /opt | |
dupes=$(port installed | cut -d '@' -f 1 | uniq -d) | |
if [ -z "$dupes" ] | |
then | |
echo "No duplicates." | |
else | |
echo `echo $dupes | wc -l` " duplicates" | |
echo $dupes | |
fi | |
port clean --all installed | |
port -f uninstall inactive | |
port uninstall leaves | |
echo "After:" | |
du -sh /opt |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment