Skip to content

Instantly share code, notes, and snippets.

@gaffneyc
Created October 28, 2013 13:55
Show Gist options
  • Save gaffneyc/7197208 to your computer and use it in GitHub Desktop.
Save gaffneyc/7197208 to your computer and use it in GitHub Desktop.
Uninstall the buggered xcode 5.0 command line tools
RECEIPT_FILE=/var/db/receipts/com.apple.pkg.CLTools_Executables.bom
RECEIPT_PLIST=/var/db/receipts/com.apple.pkg.CLTools_Executables.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."
RECEIPT_FILE=/var/db/receipts/com.apple.pkg.MacOSX10_9_SDK.bom
RECEIPT_PLIST=/var/db/receipts/com.apple.pkg.MacOSX10_9_SDK.plist
if [ ! -f "$RECEIPT_FILE" ]
then
echo "SDK not installed."
exit 1
fi
echo "SDK 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!"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment