简体   繁体   中英

Fixing homebrew on Mac OSX 10.13.2

Just wondering if anyone can help fix homebrew for me. It was working a minute ago...

I am trying to install new packages using Homebrew on my 2 Macbooks. Both are running High Sierra, which I suspect might be the problem due to Apple borking root permissions...

Anyway, my issue goes a little something like this:

❯❯❯ brew install git                                                                                                                       
Error: git 2.14.2 is already installed
To upgrade to 2.15.1, run `brew upgrade git`

Okay. Lets upgrade Git.

❯❯❯ brew upgrade git                                                                                                                       
==> Upgrading 1 outdated package, with result:
git 2.15.1
==> Upgrading git
==> Downloading https://homebrew.bintray.com/bottles/git-2.15.1.high_sierra.bottle.tar.gz
Error: curl is not executable
Warning: Bottle installation failed: building from source.
==> Downloading https://www.kernel.org/pub/software/scm/git/git-2.15.1.tar.xz
Error: curl is not executable

Strange. I use curl daily...

❯❯❯ curl                                                                                                                                   
curl: try 'curl --help' or 'curl --manual' for more information
❯❯❯ which curl                                                                                                                             
/usr/bin/curl
❯❯❯ ls -al /usr/bin/curl
-rwxr-xr-x  1 root  wheel  185104 Dec  1 15:45 /usr/bin/curl

So it exists and looks executable. Maybe the homebrew links got messed up? I will re-install curl using brew

❯❯❯ brew install curl                                                                                                                      
==> Downloading https://homebrew.bintray.com/bottles/curl-7.57.0.high_sierra.bottle.tar.gz
Error: curl is not executable
Warning: Bottle installation failed: building from source.
==> Downloading https://curl.haxx.se/download/curl-7.57.0.tar.bz2
Error: curl is not executable

So basically homebrew is not working for me. On TWO different machines running the same Mac OS version 10.13.2

NOTE : This is not limited in any way to installing git . The problem started trying to install minikube .

UPDATE

I checked my setup via brew config and noticed that although I DO have curl installed, homebrew does not see it: Curl: N/A

HOMEBREW_VERSION: 1.4.1
ORIGIN: https://github.com/Homebrew/brew
HEAD: b4d43e950fd45c24e48d6ebfd3013357abcd21a9
Last commit: 10 days ago
Core tap ORIGIN: https://github.com/Homebrew/homebrew-core
Core tap HEAD: 809322678d0fb7ab034348f86f0e452eff203b49
Core tap last commit: 73 minutes ago
HOMEBREW_PREFIX: /usr/local
HOMEBREW_VISUAL: nano
CPU: octa-core 64-bit haswell
Homebrew Ruby: 2.3.3 => /usr/local/Homebrew/Library/Homebrew/vendor/portable-ruby/2.3.3/bin/ruby
Clang: 9.0 build 900
Git: 2.14.3 => /Applications/Xcode.app/Contents/Developer/usr/bin/git
Curl: N/A
Perl: /usr/bin/perl
Python: /usr/local/opt/python/libexec/bin/python => /usr/local/Cellar/python/2.7.14/Frameworks/Python.framework/Versions/2.7/bin/python2.7
Ruby: /usr/bin/ruby => /System/Library/Frameworks/Ruby.framework/Versions/2.3/usr/bin/ruby
Java: 1.8.0_31
macOS: 10.13.2-x86_64
Xcode: 9.2
CLT: 9.2.0.0.1.1510905681
X11: 2.7.9 => /opt/X11 

The OS already has curl installed, but homebrew does not see it. I cannot install curl using homebrew (see above).

So now the problem becomes "How do I fix homebrew so it sees curl"?

I was running into the same issue yesterday. For me it was caused by a file called curl left over from a botched command in the same directory where I was running brew . Deleting that file resolved the issue.

I had same problem and I have no idea how but I fixed it. First I uninstalled any brew-version of curl that was installed. Then, when that didn't work, I navigated to \\bin\\usr\\curl to make sure it was still there. I then ran curl in terminal (just literally `curl' and then which curl to make sure it was using right one), and then reran brew and it seemed to work. I think what happens is that for some reason in new Mac files sometimes don't appear locally until you open them for the first time when using iCloud. Its happened before with other dependencies, where I had to navigate to file and physically open it before it would be locally downloaded and be recognized as a dependency. Not sure if Mac does same thing with curl. If so, quite dumb.

I had this same issue, also on Mac OS High Sierra. I ended up running brew uninstall curl . This gave me an error, but then when I installed Homebrew curl again, it worked and I could install git and others.

if you have tried everything and nothing helps, if you're facing permissions issues - try to re-install the Homebrew:

uninstall:
ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/uninstall)"

and then install it again:
/usr/bin/ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)"

helped in my case

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM