Search code examples
homebrewsha

How to update Homebrew SHA256?


This seems like a very noob question but I can't find an answer anywhere!

I'm very new to developing packages for Homebrew but when I edit my formula and come to update my package I get the following error

Error: SHA256 mismatch

My question is, how do I generate the expected SHA256 value?


Solution

  • After editing the formula, you can run brew fetch your-formula --build-from-source to fetch the tarball and display the new checksum. If you've already downloaded the tarball somewhere, you can calculate the hash with openssl sha256 < some_tarball.tar.gz or shasum -a 256 some_tarball.tar.gz.