Unable to run git on new MacBook running Big Sur
When I try to run git, I receive the following error:
xcrun: error: unable to load libxcrun (dlopen(/Library/Developer/CommandLineTools/usr/lib/libxcrun.dylib, 0x0005): could not use '/Library/Developer/CommandLineTools/usr/lib/libxcrun.dylib' because it is not a compatible arch).
I followed the method of forcing which architecture loads, suggested here, but still, I’m experiencing the error.
Now, after running that suggestion I am seeing the following error:
manpath: error: unable to load libxcrun (dlopen(/Library/Developer/CommandLineTools/usr/lib/libxcrun.dylib, 5): no suitable image found. Did find: /Library/Developer/CommandLineTools/usr/lib/libxcrun.dylib: mach-o, but wrong architecture /Library/Developer/CommandLineTools/usr/lib/libxcrun.dylib: mach-o, but wrong architecture).
I also installed homebrew prior to that error message, although I don’t see how that would be related.
I really lack experience interacting with Xcode. I feel like on my previous Mac I was just able to get up and running, without any of this hassle, but it’s been awhile so perhaps I'm forgetting.
How can I identify if Xcode and Command Line Tools are properly installed? If they are not, what is the recommended way to add them?
I tried installing homebrew to see if I could use it as a work-around, and tried using it to install git, but received the following error:
'brew install git
Updating Homebrew...
Error: Cannot install in Homebrew on ARM processor in Intel default prefix (/usr/local)!
Please create a new installation in /opt/homebrew using one of the "Alternative Installs" from: https://docs.brew.sh/Installation
I am on a MacBook Pro with the new M1 chip- could that be related?
Log out of the App Store and log back in. Logging back into the App Store can sometimes fix issues with Big Sur not downloading correctly. Use Recovery Mode. Restart your Mac and hold down Control + R before clicking Disk Mode to restart your Mac in Recovery Mode, then try installing the updates from here.
We're also seeing complaints about long download times, lag, Touch ID issues, issues with first and third-party apps including Box Drive, iMessage issues, Wi-Fi problems, Bluetooth problems, lockups, freezes, and crashes. The macOS Big Sur update is also bricking some older MacBook models.
ok will boy do I feel stupid- the problem was I did not have xcode installed. I became confused because the error messages seemed to indicated xcode was already present and there was an xcode directory on my machine- perhaps that directory comes preinstalled in preparation for xcode?
At any rate, I solved my issue by downloading and installing xcode from the app store. Maybe this will help somebody else out
Try with the following command:
sudo rm -r /Library/Developer/CommandLineTools
It will remove the command line tool and then immediately install the software automatically.
Wow. Now I also feel really stupid. I also didn't have xcode installed, but I definitely thought I did because I had it installed on my old machine. Apparently when transferring everything to the new machine, xcode didn't come along for the ride.
sudo xcodebuild -license
in terminalagree
at the end of Xcode license agreementsNow can use the git
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With