更新到OS X 10.9后,我的macport出现了问题。

我试着按照这个手册https://trac.macports.org/wiki/Migration来修复它们。

但是当我安装命令行工具时:

xcode-select——安装

我收到消息

无法安装该软件,因为它当前不可用 软件更新服务器。

与此同时,我成功地将我的另一台机器升级到OS X 10.9。并且安装的命令行工具没有问题,所以它们必须是可用的。

这里的问题是什么?


当前回答

如果您使用的软件更新服务器不包含所需的包,则可能发生此错误。

你可以通过运行来检查

defaults read /Library/Preferences/com.apple.SoftwareUpdate

看看你是否有一个名为CatalogURL或AppleCatalogURL的条目

您可以通过删除此条目或使用命令指向Apple软件更新服务器

sudo softwareupdate --clear-catalog

然后再次运行命令行工具安装。

其他回答

我遇到了同样的问题,无法安装软件,因为它目前不可从软件更新服务器。您可以尝试以下步骤,以使软件更新启动命令行工具的更新。

Check if Command Line Tools Update is mentioned in your list of softwares to be updated by using following command: softwareupdate -l If Command Line Tools Update is not mentioned in that list, then manually make it part of the list using following command which will create a temporary file: sudo touch /tmp/.com.apple.dt.CommandLineTools.installondemand.in-progress Verify that the list now has the Command Line Tools mentioned by running softwareupdate -l again. Now, press Cmd+Space to initiate Mac's Spotlight Search. Search for Software Update. Start the Software Update. That will show you following kind of dialog for installing the Command Line Tools. Install away the update and be merry. :) Remove the temporary file created in Step 2: sudo rm /tmp/.com.apple.dt.CommandLineTools.installondemand.in-progress.

如果你在最新的Mac OS X Mavericks上尝试,Xcode 5.x附带了命令行工具

所以请确保你已经安装并更新了Xcode到最新

之后,确保Xcode命令行工具使用这个命令是正确的

xcode-select -p

可能会显示一些路径

/应用程序/ xcode /内容/开发人员

使用switch命令将路径更改为正确的路径:

sudo xcode-select --switch /Library/Developer/CommandLineTools/

这将帮助您将其设置为正确的路径,之后您可以使用上面相同的命令-p来检查它是否设置正确

命令

xcode-select——安装

建议3个选项:获取Xcode;不是现在;安装。

当我选择获得完整的Xcode命令成功完成。这花了一段时间,但这样我就能完成所有的macports迁移指令。

我知道这是一个老帖子,但我今天也遇到了这个问题。我发现当我执行sudo softwareupdate -l时,命令行工具被列为更新,所以我使用sudo softwareupdate -i -a安装它们。

我在MacOS Catalina上也有同样的问题。

我想我找到了根本原因:我切换了默认的Apple ID帐户,新的帐户没有作为开发人员帐户激活。当我运行xcode-select——install命令时,我得到了与问题描述中所述相同的错误。

在阅读了stackoverflow上的这篇文章后,我访问了https://developer.apple.com/downloads,并被要求接受开发者条款。我认为它使我的帐户成为一个开发人员。然后,我试着再次运行xcode-select -install,它工作了。