I'm trying to install OpenNI2 with Homebrew, but midway I ran into this common issue "Error: SHA1 mismatch"
I tried the solution from another question that resembled this like
SHA1 error when using brew installs's brew update ; however it's already updated
I also did try to remove, as it instructed, the listed archive but I ran into the same problem.
running brew doctor didn't seem to give a good hint on a resolution.
Preq.
$ brew tap homebrew/science
$ brew tap totakke/openni2
Action
$ brew install openni2
Output
==> Downloading https://github.com/occipital/OpenNI2/archive/2.2-beta2.tar.gz
######################################################################## 100.0%
==> Downloading https://github.com/occipital/OpenNI2/pull/18.patch
######################################################################## 100.0%
Error: SHA1 mismatch
Expected: e0be30b6b9296939306155580df1ac7912d3f949
Actual: 4beb04a31a64677618801f0e95141807592442ef
Archive: /Library/Caches/Homebrew/openni2--patch-e0be30b6b9296939306155580df1ac7912d3f949.patch
To retry an incomplete download, remove the file above.
reference
The cause is hash mismatch of the patch file.
OpenNI2 formula is currently hosted by homebrew-science.
It's a homebrew-science problem.
Alternative solution is editting the formula by yourself.
$ brew edit openni2
- sha1 "e0be30b6b9296939306155580df1ac7912d3f949"
+ sha1 "4beb04a31a64677618801f0e95141807592442ef"
Thanks Takeuchi!
This means that the patch has changed since the formula was written. You should make sure that the patch has not been changed maliciously. If you trust the patch, you can run brew edit openni2 to edit the formula, remove the sha1 line corresponding to the patch, save the formula, and try again.
Related
How do I specify a version number when installing something with brew cask install?
For recent versions of Homebrew, Jethro' instructions below may not work work, because we will get an error like:
Invalid usage: Non-checksummed download of <FORMULA_NAME> formula file from an arbitrary URL is unsupported.
I found a workaround:
Go to the Homebrew Cask search page: https://formulae.brew.sh/cask/
Type and find the application you are looking for
Click Cask code link
On Github click History button
Find the version you need by reading the commit messages and view the raw file. Confirm the version variable (normally on line 2) is the version you need.
Click on the name of the commit, then three dots and select View file
Right-click Raw button and Save Link As... to download the file locally
When downloaded, go to download directory cd Downloads/
Finally run brew install --cask <FORMULA_NAME>.rb
Voilà 😄
If you need some visual assistance check the screenshots here.
You can manually point brew at the ruby file for a specific version of a cask, using a git hash. This lets you control which version is installed.
For example:
Find the cask .rb file on the homebrew-cask git repo that you
want.
Get the commit hash, eg
cee7983cd95fc92fdc250fc509f2379cefe647fe in the example above.
Git may give you instructions to view the file history locally - eg git clone https://github.com/Homebrew/homebrew-cask.git git log master -- Casks/CASK_NAME.rb
Point brew at the file using the hash: brew cask install https://raw.githubusercontent.com/caskroom/homebrew-cask/cee7983cd95fc92fdc250fc509f2379cefe647fe/Casks/minikube.rb
The other answers are pretty heavy handed, an alternative is to use the homebrew/cask-versions tap which contains a list of the old (major) versions of casks.
To use them tap it with brew tap homebrew/cask-versions and then you can search for your cask again like brew search --cask yourformula and see if what you're looking for is there.
Or you can see the complete list of casks by clicking on Casks folder at https://github.com/Homebrew/homebrew-cask-versions .
If you run
brew edit [formula]
you can change the version that matches your operating system. If you know the checksum, enter that too. If not, just comment that line out with # and it will skip the check. Then run
HOMEBREW_NO_INSTALL_FROM_API=1 brew reinstall [formula]
I'm trying to install the Arabic data on Tesseract using Terminal using this command. I have homebrew installed
brew install tesseract-ocr-[ara]
But I keep getting this error.
Any thoughts?
Error: No available formula with the name "tesseract-ocr-[ara]"
==> Searching for a previously deleted formula (in the last month)...
Error: No previously deleted formula found.
==> Searching for similarly named formulae...
Error: No similarly named formulae found.
==> Searching taps...
==> Searching taps on GitHub...
Error: No formulae found in taps.
It suggested that I do a deeper clone since I had only done a shallow clone, so I did that, but it still gave me this same result.
brew info tesseract says:
tesseract: stable 4.1.0 (bottled), HEAD
OCR (Optical Character Recognition) engine
https://github.com/tesseract-ocr/
From: https://github.com/Homebrew/homebrew-core/blob/master/Formula/tesseract.rb
==> Dependencies
Build: autoconf, autoconf-archive, automake, libtool, pkg-config
Required: leptonica, libtiff
==> Options
--HEAD
Install HEAD version
==> Caveats
This formula contains only the "eng", "osd", and "snum" language data files.
If you need all the other supported languages, `brew install tesseract-lang`.
This suggests that you need to run brew install tesseract-lang.
When I try to install PHP7 with Homebrew I get this error
Sorry, I cannot run apxs. Possible reasons follow:
1. Perl is not installed
2. apxs was not found. Try to pass the path using --with-apxs2=/path/to/apxs
3. Apache was not built using --enable-so (the apxs usage page is displayed)
The output of /usr/sbin/apxs follows:
apxs:Error: /Applications/Xcode.app/Contents/Developer/Toolchains/OSX10.12.xctoolchain/usr/local/bin/apr-1-config not found!.
configure: error: Aborting
And the command I've used to install it is :
brew install homebrew/php/php70
Here's a screenshot of my terminal:
Terminal Screen shot
Does any one have a solution for this, knowing that I've searching the web for a solution without any luck
Try this if you're upgrading:
brew reinstall php70 --without-apache
otherwise if you're installing php70 for the first time, try the following::
brew install home-brew/php/php70 --without-apache
Faced a similar issue, found it under this GitHub issue: https://github.com/Homebrew/homebrew-php/issues/3283
So I've been using homebrew to install various packages/libraries/programs on my mac. I keep running into a problem in which homebrew tells me that I have unlinked kegs in my Cellar.
For instance, upon running brew install phantomjs I received the following message:
Warning: Could not link phantomjs. Unlinking...
Error: The `brew link` step did not complete successfully
The formula built, but is not symlinked into /usr/local
You can try again using `brew link phantomjs'
Possible conflicting files are:
/usr/local/bin/phantomjs -> /usr/local/lib/node_modules/phantomjs/bin/phantomjs
I tried running brew link phantomjs as recommended, and hit a similar problem:
Error: Could not symlink file: /usr/local/Cellar/phantomjs/1.9.2/bin/phantomjs
Target /usr/local/bin/phantomjs already exists. You may need to delete it.
To force the link and overwrite all other conflicting files, do:
brew link --overwrite formula_name
The command brew link --overwrite --dry-run phantomjs gives the following message:
Would remove:
/usr/local/bin/phantomjs -> /usr/local/lib/node_modules/phantomjs/bin/phantomjs
I will probably go ahead and overwrite, but this appears to happen every time I try to install something with homebrew. Why? Why isn't homebrew working as expected?
Thanks.
From what I can tell, looks like you have previously done:
% sudo npm install -g phantomjs
In this case, you should do the following:
% sudo npm uninstall -g phantomjs
% brew link --overwrite phantomjs
I thought I'd take a crack at this. I ran into a similar problem today, and I think it may be related to this:
https://github.com/Homebrew/homebrew/issues/22408
Long story short, I think it has to do with how npm manages packages vs how brew does it. (I'm assuming you installed node with its defaults, which would have given you npm).
At some point you probably installed some package with npm. Maybe grunt, karma, etc..those by default end up in /usr/local/lib/node_modules.
Maybe one of those packages or its dependencies(or sub-dependencies) depended on phantomjs (I think Karma might use phantomjs?) Anyways, if now you are trying to brew install phantomjs, which is trying to make a symlink to it, that may be conflicting with the already existing symlink that npm created for you..
I think you can change the symlink path for that package so that brew permanently points to that already installed package in the node_modules folder. Sorry not to be more specific, I'm just figuring this out myself.
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.)
Everything worked after I ran brew update.
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
I was having the same problem as Steve S regarding epstool dependency on Octave and found this link:
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.
Cheers,
-Maashu
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.