I recently got a new M1 MacBook which I migrated to using Migration Assistant. As part of the migration, the old XCode command-line tools seem to have made their way over, install receipts and all; now, the Software Update system preference always shows there being updates available on multiple versions of the XCode Command-Line Tools. Every time I tell the system to update, it seems to redownload and reinstall the updates for all three versions, but then it once again prompts to update. Similar things happen if I use the commandline softwareupdate
tool:
grace:~ $ xcode-select --install
xcode-select: error: command line tools are already installed, use "Software Update" to install updates
grace:~ $ softwareupdate --install -a
Software Update Tool
Finding available software
Downloading Command Line Tools for Xcode
Downloading Command Line Tools beta 4 for Xcode
Downloading Command Line Tools for Xcode
Downloaded Command Line Tools for Xcode
Downloaded Command Line Tools for Xcode
Downloaded Command Line Tools beta 4 for Xcode
Installing Command Line Tools for Xcode, Command Line Tools beta 4 for Xcode, Command Line Tools for Xcode
I'd like to completely reinstall the XCode Command-Line Tools so that software update no longer attempts to update it, and so that I can properly reinstall. However, if I just sudo rm -rf /Library/Developer/CommandLineTools
, the system still thinks they're installed, and for example xcode-select --install
tells me that they're already installed, and xcode-select --reset
has no effect on this.
What do I need to do on macOS 12 to completely remove the XCode Command-Line Tools so that I can do a fresh reinstall, short of reformatting my whole laptop?