Removing uninstalled Command Line Tools from AppStore updates

I managed to fix it, it seems like I suspected, the problem was the boms in the /System/Library/Receiptsfolder.

So I booted into recovery mode, disable SIP, moved all files from that folder that had com.apple.pkg.CLTools*in their name, and the update in the App Store went away. Then I booted into recovery again to enable SIP.

It doesn't feel quite right to disable the security, but I gave it a try in this case as other similar problems seemed to be related to lingering bom files, so perhaps it makes sense.


Delete this folder and your headache's will be gone forever:

/Library/Developer/CommandLineTools


There are 2 steps for clean removal

  1. Delete /Library/Developer/CommandLineTools directory (as mentioned above).
  2. Reset to default command line tools by running

xcode-select -r

Explanation: When command line tools are installed, the path for command line tools is set to "/Library/Developer/CommandLineTools". This can be checked by running

xcode-select -p

Even if we remove the directory, system would go and check there. Once you reset the path and run xcode-select -p, it gives an error

xcode-select: error: unable to get active developer directory, use sudo xcode-select --switch path/to/Xcode.app to set one (or see man xcode-select) This would bring it to the initial state.

Running any command, say "python3 --version" without resetting the path would give:

error: tool 'python3' requires Xcode, but active developer directory '/Library/Developer/CommandLineTools' is a command line tools instance

and once you reset the path, it will will prompt to install command line tools along with :

xcode-select: note: no developer tools were found at '/Applications/Xcode.app', requesting install. Choose an option in the dialog to download the command line developer tools.