I am trying to install some software using homebrew, and when downloading and trying to install one of the dependencies, the package won't install because of an MD5 mismatch.
Is it possible to get homebrew to ignore the MD5 hash of a file and carry on with the installation?
Best Answer
As one comment left on your OP mentioned: I'd be concerned that MD5 sums weren't matching. It could mean the tarball you're downloading is corrupt, in which case doing the above to override the match will actually cause you trouble because you'll be installing broken tools. Or it could be that the tarball you're downloading can't be trusted, that you're being given something that's not legit and contains potentially harmful routines. I'd make sure you're homebrew repository is up to date with:
If indeed it is up to date you can try:
to force the installation. That option usually just forces a re-installation of an already-installed package of the same version but it may ignore an MD5 error. I poked through the install routine in
homebrew
but it wasn't apparent this would work.Worse case: you could just download the tarball for the formula, calculate the MD5 for it by hand and then update the Formula file with the appropriate MD5 value to get past the check. For example, if you were having trouble installing dos2unix you find the formula file in
/usr/local/Library/Formula/dos2unix.rb
. At the top of the file is the tarball and the MD5 sum for it:If the MD5 check is failing, download the tarball:
Calculate the MD5 checksum for the file yourself:
And then enter the value you computed in to the formula file for the bundle and re-run the install command for the bundle.