在 xcode-select --install 之后得到警报 "Can't download the software because of a network problem"

Get an alert "Can't download the software because of a network problem" after xcode-select --install

我正在尝试在我的 mac machine (macOS Catalina) 和 运行

xcode-select --install

但会收到消息提醒"Can't download the software because of a network problem"

我找到了 macOS Catalina 10.15.3 的解决方案 - 手动安装 Xcode CommandLineTools(实际上我只需要这一部分)。

步骤:

  1. 转到https://developer.apple.com/download/more/?=xcode

  2. 下载 Xcode 11.4.1.(最新的)

  3. 的命令行工具
  4. 手动安装这个包

尝试 运行 mac 终端中的以下命令,这将为 Mac os 版本 Mojave 10.14 更新 Homebrew 并更新丢失的包。

$ /usr/bin/ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)"

Refer this page for more info

如果上述方法无效:

Download command line manually from here 下载后手动安装包。

enter image description here

可能是用于下载命令行工具的 URL 设置为与 Apple 默认设置不同的更新服务器。如果是:

$ sudo defaults read /Library/Preferences/com.apple.SoftwareUpdate CatalogURL https://macpatch.mycompanydomain.com:443/index.sucatalog

$ sudo defaults delete /Library/Preferences/com.apple.SoftwareUpdate CatalogURL

$ xcode-select --install

$ sudo defaults write /Library/Preferences/com.apple.SoftwareUpdate CatalogURL https://macpatch.mycompanydomain.com:443/index.sucatalog

虽然这是一个安静的旧话题,但我想谈谈我是如何解决它的。 当您错误地设置时区时会发生这种情况。 检查时区设置是否正确,即可解决此问题。