How do I specify a version number when installing something with brew cask install?
2 Answers
Sometimes the Jethro instruction won't 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 an workaround:
- Go to the Homebrew Cask search page:
- Type and find the application you are looking for
- Click
Cask codelink - On Github click
Historybutton - 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, thenthree dotsand selectView file - Right-click
Rawbutton andSave 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.
0You 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
cee7983cd95fc92fdc250fc509f2379cefe647fein the example above.Git may give you instructions to view the file history locally - eg
git clonegit log master -- Casks/CASK_NAME.rb- Point brew at the file using the hash:
brew cask install