SHA1 error when using brew install - homebrew

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.

Related

Phraseapp: Command not found

I'm new to using phraseApp and fastlane. I was trying to pull the latest changes in Phraseapp using fastlane. After calling "phraseapp_all" I get an error message Exit status of command 'cd ../Project/Resources && phraseapp pull' was 127 instead of 0. sh: phraseapp: command not found.
I tried reinstalling phrase but no luck. Any idea on how to fix this?
Use brew install phraseApp instead of phrase only.
I thought that phraseApp was just renamed to phrase. They were somewhat different.
This worked for me.
brew tap phrase/brewed
Install phraseapp client:
brew install phrase/brewed/phraseapp

Homebrew: How do you specify a version using brew cask?

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]

Is it possible to get Homebrew to install from the latest commit on GitHub?

I need to use the LFTP program for a script I run. I tried installing it from the website using the instructions in the downloaded folder's "INSTALL" file, but running config always failed. So, I tried to have Homebrew install it, and that worked great.
I have no idea where Homebrew fetches its source from, but the latest version it pulled has a bug which the developer has since fixed on GitHub. Is there a way I can get Homebrew to install the source from the latest commit?
Some packages, such as numpy have a --HEAD option.
--HEAD
Install HEAD version
but the lftp package doesn't have this option. One solution could be to implement it yourserlf:
brew edit lftp
P.S. the homebrew version of lftp already include a patch:
https://raw.githubusercontent.com/macports/macports-ports/edf0ee1e2cf/devel/m4/files/secure_snprintf.patch
it's maybe the same you are looking for. You can see how it's apply whit brew edit lftp.

Error: SHA1 mismatch, while installing openni2

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.

Homebrew - repeated "linking" bug. What is the underlying issue here?

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.

Resources