75

More specifically, I was using homebrew to install MySQL, and I got this error:

Error: SHA1 mismatch  
Expected: f218ed64ce6e7a5d3670acdd6a18e5ed95421d1f  
Got: 3a57f6f44186e0dba34ef8b8fb4a9047e9e5d8a3  
Archive: /Users/rdp/Library/Caches/Homebrew/cmake-2.8.7.bottle.tar.gz  
(To retry an incomplete download, remove the file above.)
0

5 Answers 5

136

Everything worked after I ran brew update.

1
  • 1
    @RosePerrone: What do you do if brew update doesn't work?? [I'm trying to reinstall Octave but can't because the epstool dependency is spitting out the same error message]...
    – Steve S
    Commented Aug 5, 2014 at 14:27
8

Incase the brew update fails, try the following

cd `brew --prefix`
git remote add origin https://github.com/Homebrew/homebrew
git fetch origin
git reset --hard origin/master
1
  • git remote add origin https://github.com/Homebrew/brew.git fatal: Not a git repository (or any of the parent directories): .git Commented Oct 11, 2016 at 20:12
1

In my case the file downloaded from https://downloads.sourceforge.net/ctags/ctags-5.8.tar.gz is actually a html file. I downloaded the real file and place it at /Library/Caches/Homebrew/ctags-5.8.tar.gz. Then I run brew install ctags, everything works.

1

I was having the same problem as Steve S regarding epstool dependency on Octave and found this link:

https://web.archive.org/web/20190629035144/https://github.com/Homebrew/homebrew-science/issues/1110

Check out iml's post about 10 down from the top (his second post). As he explained, I downloaded it from the fedoraproject.org site and then moved it into the /Library/Caches/Homebrew/ directory.

0

OK, so it turns out the problem was not with Homebrew, but with cURL, which was only downloading 2 KB of whatever file I threw at it and then failing. I was able to fix this by installing the latest version of cURL.

Steps taken to resolve:

1 . Opened http://curl.haxx.se/download/curl-7.27.0.tar.gz in a web browser,

saved to /Library/Caches/Homebrew/

2 . Ran brew install curl.

3 . Any time I got a hash mismatch when downloading a dependency, I did steps 1 and 2 again, replacing the cURL package location with the one listed in the console output for the respective dependency.

4 . By default, OS X uses /usr/bin/curl, whereas the Homebrew version apparently lived in /usr/local/Cellar/curl/7.27.0/bin/curl. Which actually should have been symlinked as /usr/local/bin/curl, but wasn’t for some reason—brew link curl fixed that though (may have had to repeat for dependencies).

5 . However, Homebrew apparently has the philosophy that it’s desirable to always use Apple’s system-default binaries if they’re available. Wasn’t in my case, so I followed this advice and added export PATH=/usr/local/bin:$PATH to my bash profile, to do the reverse, and always use Homebrew binaries first, despite whatever bleeding edge repercussions that may have.

6 . brew update.

7 . brew install sshfs—success!

Not the answer you're looking for? Browse other questions tagged or ask your own question.