Homebrew in OS X 10.9.2: Error: SHA256 mismatch - shell

brew install php55
==> Downloading http://www.php.net/get/php-5.5.11.tar.bz2/from/this/mirror
######################################################################## 100.0%
Error: SHA256 mismatch
Expected: 60e14c255f2a461a7a26639b84a2fc448cc2f91c8dead0e9fd00cd8ba27a2e96
Actual: 0d9438c2557db5809f4232148ca1567516e7ece9bf8726853ceac4a111cb8690
Archive: /Library/Caches/Homebrew/php55-5.5.11
To retry an incomplete download, remove the file above.
I tried
brew cleanup && brew update
but not worked

I had the same problem with MongoDb. I was able to fix it first I changed the permission to admin.
Then I ran
brew cleanup && brew update
After that I ran
brew install mongodb
and it worked like a charm

I also tried brew cleanup and brew update but still got the same issue so i did this
brew edit <application>
and replaced sha256 value with actual value shown in error msg.
and this worked out for me, hope it helps you too.

Error: libvirt: SHA256 mismatch
Expected: ac06a7b7a74cf83e953f50e33455df97fc87880ebdac4f1dca89a62331375b1a
Actual: 3346ebf9df9fc4dd37b4c0a5bf1ce80a577b97a7a48dac3febf22aa857be9a98
File: /Users/mek/Library/Caches/Homebrew/downloads/6287efc2ec4d5147e8389b97caeb20dd0d4acec390b5910b2454a4dd018654c1--libiscsi--1.19.0.big_sur.bottle.tar.gz
To retry an incomplete download, remove the file above.
To resolve above error run below commands:
rm "filename"
brew install "package" -f

I had the same problem with watchman.
brew install watchman
response for :
==> Installing dependencies for watchman: automake, pcre
==> Installing watchman dependency: automake
==> Downloading https://ftp.gnu.org/gnu/automake/automake-1.16.1.tar.xz Already
downloaded:
/Users/piccolo/Library/Caches/Homebrew/automake-1.16.1.tar.xz
==> Downloading https://git.savannah.gnu.org/cgit/automake.git/patch/?id=a348d83
Already downloaded:
/Users/piccolo/Library/Caches/Homebrew/automake--patch-7a57ca2b91f7f3c0b168cf5ffbc8a1b2168f3886bcadcc15412281472dace3ce.git
Error: SHA256 mismatch Expected:
7a57ca2b91f7f3c0b168cf5ffbc8a1b2168f3886bcadcc15412281472dace3ce
Actual:
c048ce853eef073a5dfce34fcf9af786e8525e384e01dbbf4e6066623985d4c7
Archive:
/Users/piccolo/Library/Caches/Homebrew/automake--patch-7a57ca2b91f7f3c0b168cf5ffbc8a1b2168f3886bcadcc15412281472dace3ce.git
To retry an incomplete download, remove the file above.
then I did this:
brew uninstall automake
brew cleanup
brew update
brew install watchman
Then it worked.

Some one face the same issue.
https://github.com/Homebrew/homebrew-php/issues/875
"I checked the downloaded file, and it's the html download page rather than the tarball.
It looks like php now wants the URLs to be in the form of http://www.php.net/get/php-5.4.22.tar.bz2/from/a/mirror instead of http://www.php.net/get/php-5.4.22.tar.bz2/from/this/mirror
EDIT: I'm totally mistaken with this. from/this/mirror is the correct one, but it's borked on php's side."

I got fix, using steps wrote by MoOx:
cd /Library/Caches/Homebrew/downloads/
and delete manually the package and run againbrew upgrade works fine!

Sometimes, you may have a package that have a new SHA (eg: github updated the way it compress tar.gz), so best thing to do is to fix the original formula (you can try locally and also push your change upstream).

This can happen if a corporate security policy intercepts the request to the cask and responds with an Access Blocked page instead. You can tell by seeing the file's URL rewritten and its content being HTML. In that case you have to ask them to relax the policy or you're out of luck.

Related

Homebrew Portable Ruby Error macOS 10.14.6

Homebrew suddenly stopped working, when i run any brew command i get following output:
==> Downloading https://homebrew.bintray.com/bottles-portable-ruby/portable-ruby-2.6.3_2.yosemite.bottle.tar.gz
Already downloaded: /Users/<user>/Library/Caches/Homebrew/portable-ruby-2.6.3_2.yosemite.bottle.tar.gz
/usr/local/Homebrew/Library/Homebrew/cmd/vendor-install.sh: line 123: /usr/bin/cut: cannot execute binary file
Error: Checksum mismatch.
Expected: b065e5e3783954f3e65d8d3a6377ca51649bfcfa21b356b0dd70490f74c6bd86
Actual:
Archive: /Users/<user>/Library/Caches/Homebrew/portable-ruby-2.6.3_2.yosemite.bottle.tar.gz
To retry an incomplete download, remove the file above.
Error: Failed to upgrade Homebrew Portable Ruby!
I already tried to remove the file portable-ruby-2.6.3_2.yosemite.bottle.tar.gz but it doesn't work and i couldn't find any helpful information about this error on Google.
Any help is appreciated.
There are several things that I can think of for your situation.
Your output has yosemite identifier, to be clear, MacOS Yosemite is actually 10.10.x, it is not in the current/latest homebrew support list, and also different from 10.14 Mojave in your problem title. So if you are actually using Mojave, you can keep your brew up to date and reinstall ruby.
The latest Ruby formula is actually 2.7.x, you might want to reinstall/upgrade (brew reinstall ruby/brew upgrade ruby).
In all, if you still run into an issue, please attach the outputs of brew config and brew doctor for troubleshooting.
Try brew update-reset and then try brew upgrade.
It's set portable-ruby-2.6.3_2.yosemite.bottle.tar.gz was already downloaded so I removed it and it went through henceforth.

How to install Homebrew Portable Ruby when your system version is too old

I'm trying to install Homebrew on macOS. Once the installation finished, when I typed help I got:
Already downloaded: /.../Library/Caches/Homebrew/portable-ruby-2.6.3.mavericks.bottle.tar.gz
Error: Checksum mismatch.
Expected: ab81211a2052ccaa6d050741c433b728d0641523d8742eef23a5b450811e5104
Actual: f80fd4cc877a64b0ac1c105fdc212ca6be08bb034118900f2c2f58edcfe0dafd
Archive: /.../Library/Caches/Homebrew/portable-ruby-2.6.3.mavericks.bottle.tar.gz
To retry an incomplete download, remove the file above.
Error: Failed to install Homebrew Portable Ruby (and your system version is too old)!
I had the same question, and the solution is simple: remove the portable-ruby-2.6.3.mavericks.bottle.tar.gz you downloaded before.
rm /.../Library/Caches/Homebrew/portable-ruby-2.6.3.mavericks.bottle.tar.gz
Try running brew update-reset in your terminal and then run brew upgrade in the same terminal.
"Homebrew install fails with Error: Failed to install Homebrew Portable Ruby" helped me tremendously.
It would fail to install, because our company firewall was blocking certain downloads, like bottle, during the Homebrew update/install, but it was difficult to determine this because I would get the error above.
After removing the file, try
brew upgrade
brew update
on your personal Wifi or your phone's hotspot.
I fixed it.
First, I deleted the brew file that stores in the Library folder when using macOS.
The failure before was due to the connection. When I make sure the connection worked, it worked.
Remove the Homebrew Portable Ruby tar.gz from your Mac using:
rm <the path.tar.gz>
rm -rf <the path.tar.gz>
I've been automating this for years. There is a new something(?) in play during the Homebrew install.
I had the same error as above. I filed an issue report and got a response that fixed my problem:
CI=1 /bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)"
I'm not sure what prefixing with CI=1 does but all my automation issues went away.
To retry an incomplete download, remove the file above, then run:
rm /.../Library/Caches/Homebrew/portableruby-2.6.3.mavericks.bottle.tar.gz
and try again
my problem was:
Already downloaded: ../Library/Caches/Homebrew/portable-ruby-2.6.8_1.el_capitan.bottle.tar.gz
==> Pouring portable-ruby-2.6.8_1.el_capitan.bottle.tar.gz
Error: Failed to install ruby 2.6.8_1!
Error: Failed to install Homebrew Portable Ruby (and your system version is too old)!
Fixed with opening the system app for terminal and installing Rosetta into the prompt. This happened after system update MacOS to 11.6.7
After resolving this brew did brew upgrade finish well.
Hope this helps someone.
Here is how I fixed it:
brew cleanup then brew upgrade

Brew + suite-sparse421

I have installed brew on OSX and I have installed successfully several things.
However when I try to install suite-sparse421 (hard constraint on the version):
brew tap homebrew/versions
brew install suite-sparse421
I get the following error:
Error: No available formula with the name "suite-sparse421"
==> Searching for similarly named formulae...
Error: No similarly named formulae found.
==> Searching taps...
Error: No formulae found in taps.
Running brew doctor shows no problem (Your system is ready to brew.)
Running brew update shows no problem (Already up-to-date.)
Any idea?
Have a look at this
https://github.com/Homebrew/homebrew-science/blob/master/suite-sparse.rb
Homebrew-science/suite-sparse.rb has updated it url to download the 4.5.3 package, "http://faculty.cse.tamu.edu/davis/SuiteSparse/SuiteSparse-4.5.3.tar.gz"
If you want a specific version , why not download and build on your own.
The commands to build are pretty self explanatory there in the rb script.
As you can see in the error message there’s no formula named suite-sparse421. There’s nothing wrong with your Homebrew installation; it just doesn’t exist. See this other SO answer on how to install a previous version of a formula.
In addition to the previous right answers, the formula suite-sparse421 was removed. And all archived versions of SuiteSparse are listed on the official website.

Mongodb install failing with Homebrew - SHA1 mismatch

I am trying to install MongoDB on my Mac OSX 10.6.8. I am using the Homebrew method. Homebrew appears to be correctly installed - running brew update generates the message 'Already up-to-date'. But when I run brew install mongodb I get this message:
Error: SHA1 mismatch
Expected: 72152f9bec94aaaacb16d0b17511b0862d38ac21
Actual: 631676c22f98f9b7b87808130a4c1a99d7bf74b1
Archive: /Library/Caches/Homebrew/mongodb--patch-72152f9bec94aaaacb16d0b17511b0862d38ac21.patch
To retry an incomplete download, remove the file above.
If I remove that file, re-update brew, try to re-install mongodb, I get exactly the same result.
other action(s) taken - I ran sudo mv /opt/local ~/macports per instructions I was reading which I am not sure now where that came from, but it was that Homebrew and macports can interfere with each other.
If some understands what this problem is, and how to solve I would be grateful for the help.
When answering it would be wise to assume I am a newbie for this task.

brew install maven 404 error

I did a brew install maven and it resulted in below:
==> Downloading http://www.apache.org/dyn/closer.cgi/maven/binaries/apache-maven-3.0.4-bin.tar.gz
==> Best Mirror http://apache.oss.eznetsols.org/maven/binaries/apache-maven-3.0.4-bin.tar.gz
curl: (22) The requested URL returned error: 404
Error: Download failed: http://www.apache.org/dyn/closer.cgi/maven/binaries/apache-maven-3.0.4-bin.tar.gz
At first I thought it is a mirror problem with my network. But I changed to another network, and it is still the same. And still the same error after 4 days. I wonder if others are affected.
What should I do to install maven with brew?
If you are still getting errors with the url, try brew update and then brew install maven. Fixed the problem for me.
There is something strange with this mirror. You can change this with
brew edit maven
and change the url to
http://www.apache.org/dyn/closer.cgi/maven/maven-3/3.0.4/binaries/apache-maven-3.0.4-bin.tar.gz
e.g.
require 'formula'
class Maven < Formula
homepage 'http://maven.apache.org/'
#url 'http://www.apache.org/dyn/closer.cgi/maven/binaries/apache-maven-3.0.4-bin.tar.gz'
url 'http://www.apache.org/dyn/closer.cgi/maven/maven-3/3.0.4/binaries/apache-maven-3.0.4-bin.tar.gz'
sha1 '0de5dc162bafde3fcb0a6b009cfeea81a042523b'
def install
# Remove windows files
rm_f Dir["bin/*.bat"]
# Fix the permissions on the global settings file.
chmod 0644, Dir["conf/settings.xml"]
prefix.install %w{ NOTICE.txt LICENSE.txt README.txt }
# Install jars in libexec to avoid conflicts
libexec.install Dir['*']
bin.install_symlink Dir["#{libexec}/bin/*"]
end
end
ZenBalance's answer worked for me. I first attempted Emoloney's answer, which caused the following error when I ran brew update:
error: Your local changes to the following files would be overwritten by merge:
Library/Formula/maven.rb
Please, commit your changes or stash them before you can merge.
Aborting Error: Failure while executing: git pull -q origin refs/heads/master:refs/remotes/origin/master
To fix it:
cd /usr/local/Library/Formula
git reset --hard
Then:
brew update
brew install maven
You need to modify the URL using brew edit like Emoloney said,
but most important, don't forget to modify the sha1 code (get it from the same download page of the url). It is important to verify that you downloaded safely the exact file
For me, the following commands did the work:
brew update
brew install maven
update the mirror list of brew first
brew update
and then, try to install again. For this case
brew install maven

Resources