Downgrading a brew package can sometimes be super easy with:
brew switch <package> <version>
But that's only possible if you have previously installed that version
and haven't run brew cleanup
every since. If that's not the case you'll
get an error like:
Error: <package> does not have a version "<version>" in the Cellar.
If the Easy mode does not help you:
-
Go to formulas folder
/usr/local/Homebrew/Library/Taps/homebrew/homebrew-core/Formula
-
Check git history of the package you wanna downgrade
git log -- <package>.rb
-
Checkout a version where package was in needed version
git checkout <commit>
-
Install package skipping brew's auto update
HOMEBREW_NO_AUTO_UPDATE=1 brew install <package>
-
Pin package to avoid future updates
brew pin <package>
-
Checkout
master
again in formulas to allow brew to work properlybrew checkount master