Search code examples
macoscurlhomebrewmacos-high-sierra

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"?


Solution

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