Skip to content

Instantly share code, notes, and snippets.

@seyDoggy
Created July 26, 2012 16:19
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save seyDoggy/3183015 to your computer and use it in GitHub Desktop.
Save seyDoggy/3183015 to your computer and use it in GitHub Desktop.
This is a tool to remove all the copies of CommandLine tools that it installs.
#!/bin/bash
RECEIPT_FILE=/var/db/receipts/com.apple.pkg.DeveloperToolsCLI.bom
RECEIPT_PLIST=/var/db/receipts/com.apple.pkg.DeveloperToolsCLI.plist
if [ ! -f "$RECEIPT_FILE" ]
then
echo "Command Line Tools not installed."
exit 1
fi
echo "Command Line Tools installed, removing ..."
# Need to be at root
cd /
# Remove files and dirs mentioned in the "Bill of Materials" (BOM)
lsbom -fls $RECEIPT_FILE | sudo xargs -I{} rm -r "{}"
# remove the receipt
sudo rm $RECEIPT_FILE
# remove the plist
sudo rm $RECEIPT_PLIST
echo "Done! Please restart XCode to have Command Line Tools appear as uninstalled."
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment