ChatGPT解决这个技术问题 Extra ChatGPT

Xcode is not currently available from the Software Update server

I have problems with my macport after update to OS X 10.9.

I try to follow this manual https://trac.macports.org/wiki/Migration to fix them.

But when I install Command Line Tools:

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.

What is the problem here?

"not currently available" might just mean exactly that, that it will be available later.
Contrary to common belief, It could also means that you already have the command line tools install. Seems like the error message is a bit misleading
@AmericoSavinon you are correct as per this article: osxdaily.com/2014/02/12/install-command-line-tools-mac-os-x. In case the link goes stale, here is a snippet from the article: "Getting an error message that says “Can’t install the software because it is not currently available from the Software Update server”? Well you’re in luck, because that error message probably indicates you already have Xcode installed on the Mac."
I don't see how one is in luck if it's already installed, since xcode-select --install still asks for devtools to be added :(
If getting this message, first step is to make sure mac OS (via System Preferences) and Xcode (via App Store) are up-to-date. Then run Xcode, make sure it is operational (sometimes it asks if want to install additional components - say yes). If anything was updated, now try again.

p
pkamb

You can download the command line tools for OS X Mavericks manually from here:

https://developer.apple.com/downloads/index.action?name=for%20Xcode


This worked for me. I signed in with my Apple ID. I'm not 100% sure I even have an active Apple Developer license, but I did in the past. You may need an existing developer account to get in, but the link and the installer did work for me.
The link provided by Nikos M. is correct. Click here! However you can no longer download these tools without being a registered Apple developer. So either sign in with your Apple Developer ID or click 'Register', agree with Apple's terms, complete the signup, try the link again and "Voila" it works! Cheers, Jalh
Just tried it. it works fine as long as you login with your dev account.
+1 perfect thanks! I would just suggest to use "Command Line Tools" as search criteria: click on the following Link
Update - this worked for me to fix this issue in OSX Mojave too
u
user92

For OSX 10.11 or more you can download from here https://developer.apple.com/download/more/.

(The link in the accepted answer doesn't display command line tools for El Capitan (OSX 10.11))


Works for Sierra too (Sept. 2016).
Worked for Catalina as well (Oct. 2020)
manually installing Command Line Tools solved the issue for me as well! (macOS Catalina)
I had to follow this up with sudo xcode-select --switch /Library/Developer/CommandLineTools/ (see Basav's answer)
Catalina November 2020 Confirmed. I definitely love this guy.
H
Harm

If you are trying this on a latest Mac OS X Mavericks, command line tools come with the Xcode 5.x

So make sure you have installed & updated Xcode to latest

after which make sure Xcode command line tools is pointed correctly using this command

xcode-select -p

Which might show some path like

/Applications/Xcode.app/Contents/Developer

Change the path to correct path using the switch command:

sudo 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


Hm - I had the same old path, and updated it, but this seemed to have no effect.
@PeterEhrlich, I agree that it seemed to have no effect in that the error message still appears if you try xcode-select --install. What does seem to happen is that this corrects the path so that the command line tools which have already been installed by Xcode5 are now findable by xcode-select. After following this advice I was able to successfully install homebrew, which had been failing.
This did it for me. Was the old path the result of having upgraded from an older version?
If not command line tools are installed, this prints xcode-select: error: invalid developer directory '/Library/Developer/CommandLineTools/'. So @PeterGluck seems to be right and this answer's proposition is only tangentially relevant to what is being asked in the question.
U
Usman

I faced same problem of Can't install the software because it is currently not available from the Software Update Server. You may try following steps instead to make the Software Update initiate update for the Command Line Tools.

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.


Awesome, I got myself locked out of my apple id because I never really use it except when apple forces me to for things like this. This allowed me to install the CMD line tools without waiting for two days to have the account unlocked.
Worked for me here, too, after other options above failed.
That worked for me! The secret is in following point No. 2
I
Interlated

I deleted the command tools directory given by xcode-select -p due to npm gyp error.

xcode-select failed to install the files with the not available error.

I ran the Xcode application and the command tools installed as part of the startup.

npm worked.

However this didn't fully fix the tools. I had to use xcode-select to switch the path to the Developer directory within the Xcode application directory.

sudo xcode-select --switch /Applications/Xcode.app/Contents/Developer  

MacOS catalina.


Worked for me too. Thank you for the switch code too. How did you know to switch the file location?
@Interlated I get this error when I run the command "xcode-select: error: invalid developer directory '/Applications/Xcode.app/Contents/Developer'". Would you please help me. Thanks!
@Bahman.A did you run Xcode and install developer tools?
p
pkamb

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).

My xcode-select -p path was right, per Basav's answer, so that wasn't the issue.

I also ran sudo softwareupdate --clear-catalog per Lambda W's answer and that reset to Apple Production, but did not make a difference.

What worked was User 92's answer to visit 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 :)

I installed that, then I restarted terminal and everything was back to normal.


Installing from .dmg helped me. Thanks.
R
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.


You saved my day! Thank you!
The problem might be old, but it's still a problem. Apple doesn't give a sh*t. This is the working solution for me.
L
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

You can point back at the Apple software update server by either removing this entry or using the command

sudo softwareupdate --clear-catalog

And then run the command line tools install again.


This seems to be the cause for me. I have an internal corporate address as my CatalogURL. I haven't tried your solution, though, since I want to maintain corporate workstation compliance. Is there any way to add a source, without clearing the existing source? Otherwise, downloading the files via Apple's web portal seems to be an acceptable workaround.
WOW WTF ! I was stuck to 10.15.1, without being able to upgrade to 10.15.5 as it was saying that I was up-to-date. Doing the defaults read ... said that catalog was CatalogURL = "https://swscan.apple.com/content/catalogs/others/index-10.12-10.11-10.10-10.9-mountainlion-lion-snowleopard-leopard.merged-1.sucatalog.gz"; clearing catalog then I'm now able to update !! Thanks !!
This command no longer works on Big Sur: it prints "Catalog management is no longer supported"
If you're running on MacOS Catalina 10.16 it will say its deprecated and will be removed in one of the next versions.
v
vdsbenoit

I got the same issue on MacOS Catalina.

I think I identified the root cause: I have switched the default Apple ID account and the new one was not activated as a Developer account. When I ran the xcode-select --install command, I got the same error as stated in the issue description.

After reading this post on stackoverflow, I went on https://developer.apple.com/downloads and I was asked to accept Developers terms. I think it enabled my account as a developer one. Then, I tried to run xcode-select --install again and it worked.


k
klm123

The command

xcode-select --install

proposes 3 options: Get Xcode; Not Now; Install.

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.


When executed the command on Mavericks and tried the option,in the App store it is shown as installed,install option got the following message " Can't install the software because it is not currently available from the Software Update server" I have Xcode 5.0.2 installed on Mavericks.
This should not be the accepted answer, the one by Nikos M is much more helpful.
This had no effect for me. After I installed Xcode, Homebrew install still wanted to install command line tools -- even if I restarted the terminal (to rule out the case that environment variables needed to be updated). The fact that at developer.apple.com/download/more/?name=for%20Xcode , command line tools are offered as a separate package suggests that they are not bundled with Xcode proper.
P
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.

If you do not do these the gem install will report "You have to install development tools first." after you have already installed them.

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.


This answer appears to have solved my problem. The first line didn't execute, but I ran the second line anyway, and then everything worked.
@RedEye If the first line doesn't execute it means that Apple has already updated the license and then complains about the missing argument. It only prompts for the license the first time.
z
zack999

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'.


S
ShortFuse

I solved this by going to the App Store and installing Xcode.

It was a pretty large 11GB install, so this is probably overkill. But, as a last resort, it seems to have solve my issues. In the middle of the installation (well around 10GB), Mac OS told me there was an update to Command Line Tools for Xcode. Performing this installation won't fix anything until Xcode is fully installed.

Once the install is done, it should start working (after you accept the license agreement).


S
Sukeerthi Adiga

Command + Space

Search for Xcode

Open it and accept license

Then run again from terminal xcode-select --install


C
Community

Had the same issue and was getting the same error. When i ran xcode-select -p, it gave output as /Library/Developer/CommandLineTools. So that means xcode was already installed in my system. Then i ran steps as given on this answer. After which any command which required xcode ran successfully.