No receipt for 'com.apple.pkg.CLTools_Executables' found code example

Example 1: No Xcode or CLT version detected!

xcode-select --print-path
# in my case /Library/Developer/CommandLineTools

# the next line deletes the path returned by the command above
sudo rm -rf $(xcode-select --print-path)

# install them (again) if you don't get a default installation prompt
xcode-select --install

Example 2: No receipt for 'com.apple.pkg.CLTools_Executables' found at '/'

sudo rm -rf $(xcode-select -print-path)
Download command line tools from https://developer.apple.com/download/more/
Install it

Tags:

Misc Example