Reputation: 12915
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?
Upvotes: 293
Views: 219024
Reputation: 1080
I thought I had this problem when trying to do npm i
, but I kind of read my output too soon. Googling the output led to this answer, but the xcode-select was not my problem, but pkg-config was. Assuming that a lot of people use this for node and npm I had to install the following dependencies:
brew install pkg-config cairo pango libpng jpeg giflib librsvg
Upvotes: 0
Reputation: 11
I restarted my mac and after that it was able to download the latest command line tools successfully from the server.
Upvotes: 0
Reputation: 9837
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.
softwareupdate -l
sudo touch /tmp/.com.apple.dt.CommandLineTools.installondemand.in-progress
softwareupdate -l
again.Software Update
. Start the Software Update
.sudo rm /tmp/.com.apple.dt.CommandLineTools.installondemand.in-progress
.Upvotes: 28
Reputation: 3406
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
Upvotes: 31
Reputation: 370
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.
Upvotes: 5
Reputation: 13783
You can download the command line tools for OS X Mavericks manually from here:
Upvotes: 266
Reputation: 340
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.
Upvotes: 19
Reputation: 5956
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.
Upvotes: 20
Reputation: 6824
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).
Upvotes: 2
Reputation: 589
Command + Space
Search for Xcode
Open it and accept license
Then run again from terminal xcode-select --install
Upvotes: 1
Reputation: 648
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
.
Upvotes: 17
Reputation: 109
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.
Upvotes: 10
Reputation: 545
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))
Upvotes: 44
Reputation: 1131
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.
Upvotes: 0
Reputation: 111
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'.
Upvotes: 2
Reputation: 6089
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.
Upvotes: 3
Reputation: 12915
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.
Upvotes: 3