Xcode 当前无法从软件更新服务器获得
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/19907576/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me):
StackOverFlow
Xcode is not currently available from the Software Update server
提问by klm123
I have problems with my macport after update to OS X 10.9.
更新到 OS X 10.9 后,我的 macport 出现问题。
I try to follow this manual https://trac.macports.org/wiki/Migrationto fix them.
我尝试按照本手册https://trac.macports.org/wiki/Migration来修复它们。
But when I install Command Line Tools:
但是当我安装命令行工具时:
xcode-select --install
xcode-select --install
I get message
我收到消息
Can't install the software because it is not currently available from the Software Update server.
无法安装该软件,因为软件更新服务器当前不提供该软件。
Meanwhile I successfully updated my other machine to OS X 10.9. and installed command-line tools with no problems, so they must be available.
同时我成功地将我的另一台机器更新到了 OS X 10.9。并安装了没有问题的命令行工具,因此它们必须可用。
What is the problem here?
这里有什么问题?
采纳答案by Nikos M.
回答by Basav
If you are trying this on a latest Mac OS X Mavericks, command line tools come with the Xcode 5.x
如果您在最新的 Mac OS X Mavericks 上尝试此操作,Xcode 5.x 附带的命令行工具
So make sure you have installed & updated Xcode to latest
因此,请确保您已安装并更新 Xcode 到最新版本
after which make sure Xcode command line tools is pointed correctly using this command
之后确保使用此命令正确指向 Xcode 命令行工具
xcode-select -p
Which might show some path like
这可能会显示一些路径,例如
/Applications/Xcode.app/Contents/Developer
/Applications/Xcode.app/Contents/Developer
Change the path to correct path using the switch command
使用 switch 命令将路径更改为正确的路径
xcode-select --switch /Library/Developer/CommandLineTools/
this should help you set it to correct path, after which you can use the same above command -p to check if it is set correctly
这应该可以帮助您将其设置为正确的路径,之后您可以使用上述相同的命令 -p 来检查它是否设置正确
回答by user92
For OSX 10.11 or more you can download from here https://developer.apple.com/download/more/.
对于 OSX 10.11 或更高版本,您可以从这里下载https://developer.apple.com/download/more/。
(The link in the accepted answer doesn't display command line tools for El Capitan (OSX 10.11))
(已接受答案中的链接不显示 El Capitan (OSX 10.11) 的命令行工具)
回答by Stephen Marsh
I just got the same error after I upgraded to 10.14 Mojave and had to reinstall command line tools (I don't use the full XCode IDE and wanted command line tools a la carte).
升级到 10.14 Mojave 后,我遇到了同样的错误,不得不重新安装命令行工具(我没有使用完整的 XCode IDE,想要点菜的命令行工具)。
My xcode-select -p
path was right, per Basav's answer, so that wasn't the issue.
xcode-select -p
根据Basav 的回答,我的道路是正确的,所以这不是问题。
I also ran sudo softwareupdate --clear-catalog
per Lambda W's answerand that reset to Apple Production, but did not make a difference.
我还sudo softwareupdate --clear-catalog
按照Lambda W 的回答运行,并重置为 Apple Production,但没有任何区别。
What worked was User 92's answerto visit https://developer.apple.com/download/more/.
有效的是用户 92对访问https://developer.apple.com/download/more/的回答。
From there I was able to download a .dmg
file that had a GUI installer wizard for command line tools :)
从那里我能够下载一个.dmg
文件,该文件具有用于命令行工具的 GUI 安装程序向导:)
I installed that, then I restarted terminal and everything was back to normal.
我安装了它,然后我重新启动了终端,一切都恢复了正常。
回答by Lambda W
This error can occur if you are using a software update server which doesn't host the required package.
如果您使用的软件更新服务器不承载所需的程序包,则可能会发生此错误。
You can check this by running
您可以通过运行来检查这一点
defaults read /Library/Preferences/com.apple.SoftwareUpdate
and seeing if you have an entry called CatalogURL or AppleCatalogURL
并查看您是否有名为 CatalogURL 或 AppleCatalogURL 的条目
You can point back at the Apple software update server by either removing this entry or using the command
您可以通过删除此条目或使用命令来指向 Apple 软件更新服务器
sudo softwareupdate --clear-catalog
And then run the command line tools install again.
然后再次运行命令行工具安装。
回答by Roy
I know this is an old post but I also ran into this problem today. I found out that when I executed sudo softwareupdate -l
the Command Line Tools were listed as an update, so I installed them using sudo softwareupdate -i -a
.
我知道这是一个旧帖子,但我今天也遇到了这个问题。我发现当我执行sudo softwareupdate -l
命令行工具时被列为更新,所以我使用sudo softwareupdate -i -a
.
回答by klm123
The command
命令
xcode-select --install
xcode-select --install
proposes 3 options: Get Xcode; Not Now; Install.
提出 3 个选项:获取 Xcode;现在不要; 安装。
When I choose to get full Xcode the command finished successfully. It took a while, but this way I was able to complete all macports migration instructions.
当我选择获取完整的 Xcode 时,命令成功完成。花了一段时间,但通过这种方式,我能够完成所有 macports 迁移说明。
回答by Peter Wooster
Once you get the command line tools loaded as described by Nikos M in his excellent answer above you will need to agree to the gcc license and if you are using ruby gems you may need to link llvm-gcc as gcc-4.2.
一旦您按照 Nikos M 在上面的出色回答中的描述加载了命令行工具,您将需要同意 gcc 许可证,如果您使用的是 ruby gems,您可能需要将 llvm-gcc 链接为 gcc-4.2。
If you do not do these the gem install will report "You have to install development tools first." after you have already installed them.
如果您不执行这些操作,gem install 将报告“您必须先安装开发工具”。在你已经安装它们之后。
The steps are:
步骤是:
sudo gcc
sudo ln -s /usr/bin/llvm-gcc /usr/bin/gcc-4.2
The gcc must be run once under sudo so Apple can update their license info, you don't need an input file, it will update the license before it checks its arguments. The link is needed so that ruby 1.9 can find the compiler when building certain gems, such as the debugger. This may be fixed in ruby 2.x, but I'll cross that bridge when I get there.
gcc 必须在 sudo 下运行一次,以便 Apple 可以更新他们的许可证信息,您不需要输入文件,它会在检查其参数之前更新许可证。需要该链接,以便 ruby 1.9 在构建某些 gem(例如调试器)时可以找到编译器。这可能会在 ruby 2.x 中修复,但是当我到达那里时我会穿过那座桥。
回答by zack999
I had to run Xcode.app and agree to the License Agreement
I had to run Xcode.app and agree to the License Agreement
Setup: Brand new MacBook with Mavericks, then brew install and other c/l type things 'just work'.
设置:带有 Mavericks 的全新 MacBook,然后 brew install 和其他 c/l 类型的东西“正常工作”。
回答by Sukeerthi Adiga
Command + Space
命令 + 空格
Search for Xcode
搜索 Xcode
Open it and accept license
打开它并接受许可
Then run again from terminal xcode-select --install
然后从终端再次运行 xcode-select --install