No receipt for 'com.apple.pkg.CLTools_Executables' found at '/'. 解决方案

/ 默认分类 / 没有评论 / 1568浏览
  1. 执行如下命令 /usr/sbin/pkgutil --packages | grep CLTools 如果没有返回值,说明缺少xcode相关工具包
  2. 依此执行如下命令
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
# 重新执行步骤一的命令,得出如下结果即可解决
/usr/sbin/pkgutil --packages | grep CLTools
com.apple.pkg.CLTools_Executables
com.apple.pkg.CLTools_SDK_macOS110
com.apple.pkg.CLTools_SDK_macOS1015
com.apple.pkg.CLTools_macOS_SDK