Java基础、中级、高级、架构面试资料

xcode-select: error: command line tools are already installed, use “Software Update” to install updates

业余杂谈 herman 3945浏览
公告:“业余草”微信公众号提供免费CSDN下载服务(只下Java资源),关注业余草微信公众号,添加作者微信:xttblog2,发送下载链接帮助你免费下载!
本博客日IP超过2000,PV 3000 左右,急需赞助商。
极客时间所有课程通过我的二维码购买后返现24元微信红包,请加博主新的微信号:xttblog2,之前的微信号好友位已满,备注:返现
受密码保护的文章请关注“业余草”公众号,回复关键字“0”获得密码
所有面试题(java、前端、数据库、springboot等)一网打尽,请关注文末小程序
视频教程免费领
腾讯云】1核2G5M轻量应用服务器50元首年,高性价比,助您轻松上云

最近有不少网友加我微信说,我博客怎么停更了?

我这里回复一下,没有停更,只是最近比较忙,没时间发文章,但是公众号每天发的都有文章!

今天周六,抽空说一下同事 Mac 遇到的一个 xcode-select 问题。他在执行 xcode-select –install 时,终端打印出了一个 error:

xcode-select: error: command line tools are already installed, use “Software Update” to install updates

这句话的意思时说,xcode-select 的 command line tools 命令行工具已经存在了,可以选择”Software Update” 进行安装更新。

但是当你执行“Software Update”时,又提示,zsh: command not found: Software。

所以,不是这样进行更新的。但是我们可以执行“ls -l /Library/Developer/CommandLineTools/SDKs”命令查看我们安装的命令行工具的版本。

s -l /Library/Developer/CommandLineTools/SDKs 
total 0
lrwxr-xr-x  1 root  wheel   14  3  6 10:56 MacOSX.sdk -> MacOSX11.1.sdk
drwxr-xr-x  8 root  wheel  256  7 10  2020 MacOSX10.15.sdk
drwxr-xr-x  7 root  wheel  224 11 30 20:33 MacOSX11.1.sdk

或者我们也可以执行:brew config,查看当前系统的CLT(Command Line Tools)版本。

HOMEBREW_VERSION: 2.4.7
ORIGIN: https://github.com/Homebrew/brew
HEAD: 0f6bc6274f8fc0cfc19636688fc8aa6752d0c296
Last commit: 8 months ago
Core tap ORIGIN: https://github.com/Homebrew/homebrew-core
Core tap HEAD: 6c5fc2a04a6f21c2d9ef63abb559ff6b6891d432
Core tap last commit: 50 minutes ago
HOMEBREW_PREFIX: /usr/local
HOMEBREW_MAKE_JOBS: 4
CPU: quad-core 64-bit kabylake
Homebrew Ruby: 2.6.3 => /System/Library/Frameworks/Ruby.framework/Versions/2.6/usr/bin/ruby
Clang: 12.0 build 1200
Git: 2.24.3 => /Library/Developer/CommandLineTools/usr/bin/git
Curl: 7.64.1 => /usr/bin/curl
Java: 1.8.211.12, 1.8.0_211, 1.8.0_74
macOS: 11.2.1-x86_64
CLT: 12.4.0.0.1.1610135815
Xcode: N/A

如果你觉得你的 CLT 版本过低,可以选择先删除它,再重新安装它。

sudo rm -rf /Library/Developer/CommandLineTools
sudo xcode-select --install

也或者,访问 https://developer.apple.com/download/more/到苹果官网去下载新的 CLT 工具进行安装。

Command Line Tools

注意,访问苹果官网下载,需要进行账号登录。推荐大家选择稳定的版本进行安装!

参考资料

业余草公众号

最后,欢迎关注我的个人微信公众号:业余草(yyucao)!可加作者微信号:xttblog2。备注:“1”,添加博主微信拉你进微信群。备注错误不会同意好友申请。再次感谢您的关注!后续有精彩内容会第一时间发给您!原创文章投稿请发送至532009913@qq.com邮箱。商务合作也可添加作者微信进行联系!

本文原文出处:业余草: » xcode-select: error: command line tools are already installed, use “Software Update” to install updates