-
Find the formula for the version you want to install:
- Visit https://github.com/Homebrew/homebrew-core/tree/master/Formula
- Click the file with your formula (e.g. “composer.rb”)
- Click “History” (top right)
- Click the commit hash for the version you want to download
- Click the three dots (top right of diff) and choose “view file”
- Click “Raw” and copy the raw URL from the browser address bar.
For example, composer 1.10.15 lives here: https://github.com/Homebrew/homebrew-core/blob/9e6e6a1ca8551901bff69d329c7fbb9007064134/Formula/composer.rb
With the raw file at: https://raw.githubusercontent.com/Homebrew/homebrew-core/9e6e6a1ca8551901bff69d329c7fbb9007064134/Formula/composer.rb
-
Download the raw formula to disk:
cd ~/Desktop curl -O https://raw.githubusercontent.com/Homebrew/homebrew-core/9e6e6a1ca8551901bff69d329c7fbb9007064134/Formula/composer.rb
-
Install that recipe from disk:
brew install composer.rb
(changecomposer.rb
to the formula name) -
Clean up:
rm composer.rb
(changecomposer.rb
to the formula name) -
Check the version for whatever you just installed:
❯ composer --version Composer version 1.10.15 2020-10-13 15:59:09
-
-
Save jpluimers/8da7d1f366936b0363e98b8baef1af98 to your computer and use it in GitHub Desktop.
Install an old version with homebrew for macOS
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
For casks, steps based on https://stackoverflow.com/questions/58373704/how-do-you-specify-a-version-using-brew-cask
Cask example: beyond compare where I wanted version 4
Find the ruby file in the casks: https://github.com/Homebrew/homebrew-cask/tree/master/Casks
In this case https://github.com/Homebrew/homebrew-cask/blob/master/Casks/b/beyond-compare.rb
Click on History go get to the commits for
beyond-compare.rb
fileIn this case: https://github.com/Homebrew/homebrew-cask/commits/master/Casks/b/beyond-compare.rb
Find the most recent commit before the next version you don't want (we want the most recent 4.x which was
4.4.7.28397
, so we get the commit just before the oldest 5.x which was5.0.0.29773
)In this case: Homebrew/homebrew-cask@7c66c95
View the pretty-printed ruby file
beyond-compare.rb
In this case: https://github.com/Homebrew/homebrew-cask/blob/7c66c9516038b2d4a7d543340b0905f9fba0e439/Casks/b/beyond-compare.rb
Click on the "RAW" button to view the RAW file
In this case https://raw.githubusercontent.com/Homebrew/homebrew-cask/7c66c9516038b2d4a7d543340b0905f9fba0e439/Casks/b/beyond-compare.rb
Download this file locally:
curl --remote-name https://raw.githubusercontent.com/Homebrew/homebrew-cask/7c66c9516038b2d4a7d543340b0905f9fba0e439/Casks/b/beyond-compare.rb
Install that one using prefix
brew install --cask beyond-compare.rb