291

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?

mrk
  • 4,999
  • 3
  • 27
  • 42
klm123
  • 12,105
  • 14
  • 57
  • 95
  • "not currently available" might just mean exactly that, that it will be available later. – zaph Nov 11 '13 at 13:36
  • 35
    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 – Americo Savinon Nov 20 '13 at 20:59
  • xcode-select -p gave the follwoing output /Library/Developer/CommandLineTools. I am able to view Library and usr directories in the given path.Still I get the same error. Did you face the same issue ? – Ram Feb 25 '14 at 14:54
  • 1
    @AmericoSavinon you are correct as per this article: http://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." – pcantalupo May 01 '14 at 16:46
  • 5
    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 :( – Kato May 02 '14 at 05:11
  • 2
    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. – ToolmakerSteve Oct 02 '20 at 14:36
  • Hey I was encountering issues doing "xcode-select --install" so I manually downloaded Xcode 12.0.1 for Mojave. But even after downloading the .xip, and unzipping it, I still have the same error. -- Edit: Turns out I had to move xcode to Applications folder. This fixed the issue. – Josiah Coad Oct 04 '20 at 06:24

16 Answers16

266

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

pkamb
  • 33,281
  • 23
  • 160
  • 191
Nikos M.
  • 13,685
  • 4
  • 47
  • 61
  • 2
    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. – Jim Stewart Nov 14 '13 at 17:50
  • 3
    The link provided by Nikos M. is correct. Click [here](https://developer.apple.com/downloads/index.action?name=for%20Xcode%20- "Apple Developer Donwloads")! 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 –  Nov 30 '13 at 03:28
  • 2
    Just tried it. it works fine as long as you login with your dev account. – Nikos M. Dec 05 '13 at 10:54
  • Using Safari, this worked for me. The JavaScript on the page didn't appear to be properly working in Chrome. – popedotninja May 23 '14 at 20:42
  • See my reply for additional steps that may be needed by ruby gem users. – Peter Wooster Jun 14 '14 at 22:04
  • 18
    +1 perfect thanks! I would just suggest to use "Command Line Tools" as search criteria: click on the following [Link](https://developer.apple.com/downloads/?name=Command%20Line%20Tools) – Luca Borrione Aug 18 '15 at 15:55
  • 4
    Update - this worked for me to fix this issue in OSX Mojave too – kb_ Oct 31 '18 at 18:59
  • 1
    This also worked for me on Mojave. I downloaded and installed the Command Line Tools for XCode 10.1 Beta 2 – Terry Ray Nov 01 '18 at 17:25
  • Very frustrating that this can't be installed naturally, but this link did work for me. Found the right version that matched my MacOS and Xcode versions and I was good to go. – jdavis Jun 04 '19 at 15:33
  • It only shows either the latest beta versions or older versions of the command line tools on MacOS 10.16 Catalina. – Markus Rudel Oct 26 '20 at 20:22
  • On Mac Big Sur, and I've had to do this TWICE already. Using NVM which might be a problem. Still, would be nice to understand the actual source of the issue beyond _deleting and reinstalling_. – allthesignals May 03 '21 at 19:09
44

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

user92
  • 545
  • 6
  • 9
31

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

Harm
  • 590
  • 3
  • 21
Basav
  • 3,176
  • 1
  • 22
  • 20
  • 1
    Hm - I had the same old path, and updated it, but this seemed to have no effect. – Peter Ehrlich May 16 '14 at 18:54
  • 2
    @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. – Peter Gluck Jun 16 '14 at 06:24
  • This did it for me. Was the old path the result of having upgraded from an older version? – Bobson Oct 08 '14 at 12:06
  • 3
    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. – ivan_pozdeev Nov 01 '18 at 17:28
  • fwiw, I'm pretty sure I did this during a previous upgrade and it fixed my problem. Now, after upgrading to Ventura (macos 13, darwin 22), it's no longer the case: `$ xcode-select -p` shows `/Applications/Xcode.app/Contents/Developer`, but if I switch to `/Library/Developer/CommandLineTools/`, then `xcodebuild -license` (which I have to accept, and btw accepting requires running w/ `sudo`) results in: `xcode-select: error: tool 'xcodebuild' requires Xcode, but active developer directory '/Library/Developer/CommandLineTools' is a command line tools instance`. After switching back, it worked. – michael Nov 27 '22 at 08:35
27

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.

  1. Check if Command Line Tools Update is mentioned in your list of softwares to be updated by using following command: softwareupdate -l
  2. 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
  3. Verify that the list now has the Command Line Tools mentioned by running softwareupdate -l again.
  4. Now, press Cmd+Space to initiate Mac's Spotlight Search. Search for Software Update. Start the Software Update.
  5. That will show you following kind of dialog for installing the Command Line Tools. Install away the update and be merry. :) enter image description here
  6. Remove the temporary file created in Step 2: sudo rm /tmp/.com.apple.dt.CommandLineTools.installondemand.in-progress.
Uthman
  • 9,251
  • 18
  • 74
  • 104
20

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.

Interlated
  • 5,108
  • 6
  • 48
  • 79
  • Worked for me too. Thank you for the switch code too. How did you know to switch the file location? – bubbaspaarx Sep 22 '20 at 09:09
  • 4
    @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 Oct 02 '20 at 23:31
  • @Bahman.A did you run Xcode and install developer tools? – Interlated Oct 05 '20 at 14:50
19

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.

pkamb
  • 33,281
  • 23
  • 160
  • 191
Stephen Marsh
  • 241
  • 2
  • 8
17

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.

Roy
  • 648
  • 9
  • 17
10

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.

Lambda W
  • 109
  • 1
  • 2
  • 1
    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. – StockB Nov 30 '17 at 14:37
  • 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 !! – VivienG Jun 03 '20 at 21:54
  • 2
    This command no longer works on Big Sur: it prints "Catalog management is no longer supported" – Tomáš Hübelbauer Aug 17 '20 at 14:25
  • If you're running on MacOS Catalina 10.16 it will say its deprecated and will be removed in one of the next versions. – Markus Rudel Oct 26 '20 at 20:19
5

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.

vdsbenoit
  • 321
  • 3
  • 7
3

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.

klm123
  • 12,105
  • 14
  • 57
  • 95
  • 2
    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. – Ram Feb 25 '14 at 14:48
  • This should not be the accepted answer, the one by Nikos M is much more helpful. – Peter Wooster Jun 14 '14 at 20:42
  • 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 https://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. – ivan_pozdeev Nov 01 '18 at 17:37
3

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.

Peter Wooster
  • 6,009
  • 2
  • 27
  • 39
  • 1
    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 Jul 01 '14 at 14:25
  • 1
    @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. – Peter Wooster Jul 03 '14 at 12:11
2

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

zack999
  • 111
  • 2
2

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

ShortFuse
  • 5,970
  • 3
  • 36
  • 36
1

Command + Space

Search for Xcode

Open it and accept license

Then run again from terminal xcode-select --install

Sukeerthi Adiga
  • 531
  • 5
  • 9
0

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.

Community
  • 1
  • 1
rajya vardhan
  • 1,121
  • 4
  • 16
  • 29
0

I restarted my mac and after that it was able to download the latest command line tools successfully from the server.