
Homebrew makes it very difficult to install older versions of a formula.
And no, versioned formulae are not a real solution. Thankfully, we can cobble together some incantations to get what we want.
The solution comes from Carlo Cabrera on GitHub . It involves:
- Making a local tap ("local" because we won't be publishing this to a remote Git repository)
- Copying a specific version of a formula to our local tap
- Installing the local copy of the formula
And note that this relatively simple solution only works for formulae, casks require some more advanced shell scripting.

Installing Old Homebrew Cask Versions
Oct 4, 2025 · 5 min read
Homebrew makes it very difficult to install older versions of a cask.
Installation
For our example formula, I'm going to use Zstd v1.5.5. This came from a real world need of mine while developing Node-API modules for Igir .
First, we need to check out the entire Git history of homebrew/core so that brew can scan its history for the desired version of the formula:
$ brew tap --force homebrew/coreWe only need to tap once. Subsequent runs should use brew update to update the tap.
Then, we need to make our local tap. Again, we only need to do this once ever:
$ brew tap-new homebrew/localThen, we'll "extract" (copy) a specific version of a formula into our local tap. Again, we'll only need to do this once ever:
$ brew extract --version=1.5.5 zstd homebrew/localThen, we'll install the formula, which may cause a build process:
$ brew install homebrew/local/zstd@1.5.5Note: you can use the command brew edit homebrew/local/zstd@1.5.5 to edit the formula file in case of build failures. In the case of Zstd v1.5.5, I needed to add -DCMAKE_POLICY_VERSION_MINIMUM=3.5 to the cmake command to get the build to succeed.
Typically, brew install will create all appropriate symlinks, but if you already have the formula installed then you'll need to follow the printed instructions to overwrite the symlinks:
$ brew link --overwrite zstd@1.5.5Uninstallation
If you later want to swap back to the latest version, run the commands:
$ brew unlink zstd
$ brew link --overwrite zstdTo uninstall the formula, run:
$ brew uninstall zstd@1.5.5To delete the local tap and all copied formulae, run:
$ brew untap homebrew/localAnd to remove your local copy of homebrew/core (and stop it from updating on every brew update), run:
$ brew untap homebrew/coreAs a dotfile function
Combining this together with the easier method to install old cask versions, we can write one clean function that you can put in your dotfiles:
1# Install a specific version of a Homebrew formula
2# @param {string} $1 Formula name
3# @param {string} $2 Formula version (exact)
4vintage() {
5 # Figure out the relevant tap
6 local brew_tap
7 local is_cask=false
8 if brew search --cask "/^${1:?}$/" &> /dev/null; then
9 brew_tap="homebrew/cask"
10 is_cask=true
11 else
12 brew_tap="homebrew/core"
13 fi
14
15 # Ensure the appropriate tap is tapped and up to date
16 if brew tap | grep -xq "${brew_tap}"; then
17 brew update
18 else
19 brew tap --force "${brew_tap}"
20 fi
21
22 # Ensure homebrew/local is created
23 brew tap | grep -xq homebrew/local \
24 || brew tap homebrew/local
25
26 if [ "${is_cask}" = false ]; then
27 # If the formula is already installed, re-link it
28 if brew list -1 | grep -xq "${1:?}@${2:?}"; then
29 brew unlink "${1:?}@${2:?}"
30 brew link --overwrite "${1:?}@${2:?}"
31 return 0
32 fi
33
34 # Install the formula and ensure it's linked
35 brew install "homebrew/local/${1:?}@${2:?}" \
36 || brew link --overwrite "${1:?}@${2:?}"
37 else (
38 # Sub shell to make `cd` safe
39 cd "$(brew --repository "${brew_tap}")" || return 1
40
41 # Emulate `brew extract` for casks
42 local cask_path
43 cask_path=$(git ls-files 'Casks/*' | grep -E "/${1:?}\.rb$")
44 local version_match
45 version_match=$(git rev-list --all "${cask_path}" \
46 | xargs -n1 -I% git --no-pager grep --fixed-strings "version \"${2:?}\"" % -- "${cask_path}" \
47 2> /dev/null | head -1)
48 local commit_hash="${version_match%%:*}"
49 local local_cask_dir
50 local_cask_dir="$(brew --repository homebrew/local)/Casks"
51 if [ ! -d "${local_cask_dir}" ]; then
52 mkdir -p "${local_cask_dir}"
53 fi
54 local local_cask_file="${local_cask_dir}/${1:?}@${2:?}.rb"
55 git show "${commit_hash}:${cask_path}" \
56 | sed "s/cask \"${1:?}\"/cask \"${1:?}@${2:?}\"/" \
57 > "${local_cask_file}"
58
59 # Install the formula
60 brew install --cask "homebrew/local/${1:?}@${2:?}"
61 ) fi
62}

Installing Old Homebrew Cask Versions
Oct 4, 2025 · 5 min read
Homebrew makes it very difficult to install older versions of a cask.
Caveats
The main caveat is if you're installing an older version of a formula, it may need old versions of its dependencies. Each situation is going to be unique, but some situations may be resolved by making changes to the formula file and then running brew install again:
$ brew edit homebrew/local/zstd@1.5.5



