| 164 | == Reinstalling the command line tools == #reinstall-clt |
| 165 | |
| 166 | When the command line tools package is installed, a receipt is generated that can be accessed with `/usr/sbin/pkgutil`. |
| 167 | When upgrading Xcode, this receipt can be lost even though the command line tools remain installed. |
| 168 | Without this receipt, MacPort cannot determine which version of the command line tools package is installed. |
| 169 | |
| 170 | '''Fix:'''[[BR]] |
| 171 | |
| 172 | Reinstalling the command line tools package fixes the problem. |
| 173 | * Download the command line tools package from the [https://developer.apple.com/download/more/?=command%20line%20tools Apple Developer] site. |
| 174 | * Or, on Mac OS X 10.9 or greater, Software Update can reinstall the package: |
| 175 | * {{{sudo touch /tmp/.com.apple.dt.CommandLineTools.installondemand.in-progress}}} |
| 176 | * {{{softwareupdate -l}}} |
| 177 | * [https://support.apple.com/en-us/HT201541 Run Software Update] |
| 178 | * {{{sudo rm /tmp/.com.apple.dt.CommandLineTools.installondemand.in-progress}}} |
| 179 | Please note that Software Update will continue to list the command line tools package as outdated so long as the file `/tmp/.com.apple.dt.CommandLineTools.installondemand.in-progress` exists.[[BR]] |
| 180 | Be sure to remove it once the package is reinstalled. |