Created
May 19, 2015 08:56
-
-
Save meritozh/9742f9f7050059b19704 to your computer and use it in GitHub Desktop.
Remove CLT via lsbom and rm in OS X yosemite
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 | |
DEV_SDK_RECEIPT_FILE=/var/db/receipts/com.apple.pkg.DevSDK_OSX1010.bom | |
DEV_SDK_RECEIPT_PLIST=/var/db/receipts/com.apple.pkg.DevSDK_OSX1010.plist | |
DEV_TOOLS_RECEIPT_FILE=/var/db/receipts/com.apple.pkg.CLTools_Executables.bom | |
DEV_TOOLS_RECEIPT_PLIST=/var/db/receipts/com.apple.pkg.CLTools_Executables.plist | |
if [ ! -f "$DEV_TOOLS_RECEIPT_FILE" ] | |
then | |
echo "Command Line Tools not installed." | |
exit 1 | |
fi | |
echo "Command Line Tools installed, removing ..." | |
# Need to be at root | |
cd / | |
for BOM_FILE in $DEV_SDK_RECEIPT_FILE $DEV_TOOLS_RECEIPT_FILE | |
do | |
lsbom -fls $BOM_FILE | sudo xargs -I{} rm -r "{}" | |
sudo rm $BOM_FILE | |
done | |
# remove the plist files | |
sudo rm $DEV_SDK_RECEIPT_PLIST $DEV_TOOLS_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
You can modify it to delete anything via lsbom and rm that the software are installed by pkg installer