After upgrading to the most recent version of a homebrew formula, I noticed a bug that wasn’t present in the previous version. I wanted to downgrade to the previous version, but there was no real easy way of doing so. After doing a little research I found a way that is pretty simple.
- First, you need to note the version number of the formula you want to downgrade to.
- Uninstall the current formula.
- Make a fork of the homebrew-core repository. I noticed a TON of forks of this repository when I first navigated there, so that was how I knew I was on the right track.
- Find the version of the formula you want to downgrade to, and copy the contents of the corresponding .rb file.
- Switch back to the main branch of the forked repository, and find the latest .rb file for the formula you want to downgrade.
- Replace the contents of the latest .rb file with the copied contents from step 4.
- Commit and push the changes. You can do all of this through the github gui.
- Ensure the formula is uninstalled so we don’t get any conflicts with the following steps.
- Install the formula using the following command:
brew install {github_username}/homebrew-core/{formula_name}
- You should now have the formula installed at the version you wanted to downgrade to.
More Info: How to create and maintain a tap