SHA256 mismatch


(Martin Tóth) #1

After running brew udate && brew upgrade and seeing the mismatch error, I’ve found the error comes from trying to update jpeg package:

% brew upgrade jpeg
==> Upgrading 1 outdated package, with result:
jpeg 9c
==> Upgrading jpeg
==> Downloading http://www.ijg.org/files/jpegsrc.v9c.tar.gz
######################################################################## 100.0%
Error: SHA256 mismatch
Expected: 1f3a3f610f57e88ff3f1f9db530c605f3949ee6e78002552e324d493cf086ad4
Actual: 650250979303a649e21f87b5ccd02672af1ea6954b911342ea491f351ceb7122
Archive: /Users/martin/Library/Caches/Homebrew/jpeg-9c.tar.gz
To retry an incomplete download, remove the file above.

I’ve run brew cleanup, and I’ve got a few OSX version warnings from brew doctor.

% brew --version
    Homebrew 1.5.13-6-g6654ff6
    Homebrew/homebrew-core (git revision 9c38a2; last commit 2018-03-29)
% sw_vers 
    ProductName:	Mac OS X
    ProductVersion:	10.10.5
    BuildVersion:	14F2511

What are my options? Is it SHA256 mismatch due to older OSX version? Do I need to upgrade? Is this possible to resolve on 10.10.5?


(Eduard Rozenberg) #2

I don’t know if the mismatch is due to being on older MacOS (I don’t have that Mac version running). I would expect after a successful brew update that you’d have the latest jpeg formula with correct checksum.

Run $ brew edit jpeg. The latest jpeg formula has the correct expected checksum starting with 650250 as you can see here https://github.com/Homebrew/homebrew-core/blob/master/Formula/jpeg.rb

The quick “hackish” approach is to put the correct checksum in your jpeg.rb when you edit it.

The ideal approach would be to figure out why you don’t already have the current version of the jpeg.rb formula after running $ brew update. It’s something you’d need to figure out, as the potential reasons are more than a few.


(Martin Tóth) #3

Fixed: https://github.com/Homebrew/homebrew-core/pull/25918


(Martin Tóth) #4

Thank you for your effort!


(Arti Villa) #5

I’m running into a similar issue. Does the library author need to create the SHA245 or can I create a brew formula and link the github archived .tar.gz file and then tap into my github remote URL?


(Sean Molenaar) #6

There’s no need for the SHA to be defined by upstream but it is nice to have it verifiable that way.


(Arti Villa) #7

Is there a specific way to create this SHA value? I’m trying to create this for an existing python application (Ideally I’d like this in a working state before sending in a PR to the author) but I can’t get this to install using thebrew tap artivilla/homebrew-termtosvg brew intall termtosvg method.


(Sean Molenaar) #8

Here’s a blog on it I found: http://notepad2.blogspot.com/2012/07/mac-os-x-how-to-generate-md5-sha1.html