I followed these stack overflow instructions. I think the other solution on the same thread might make even more sense, but if you are going for version 2.2.10, the below code added to a file named with an .rb extension and running brew install --cask the_file.rb should do the trick (once you have run brew remove vagrant.)
It’s basically just updating the git commit and sha256 numbers that the url the little script pulls from references.
cask "vagrant" do
version "2.2.10"
sha256 "913d959455d37a0bb410c89ba3aedc886ccc76ce06bae7b228ba7454294325da"
url "https://releases.hashicorp.com/vagrant/#{version}/vagrant_#{version}_x86_64.dmg",
verified: "hashicorp.com/vagrant/"
name "Vagrant"
desc "Development environment"
homepage "https://www.vagrantup.com/"
livecheck do
url "https://github.com/hashicorp/vagrant"
strategy :git
end
pkg "vagrant.pkg"
uninstall script: {
executable: "uninstall.tool",
input: ["Yes"],
sudo: true,
},
pkgutil: "com.vagrant.vagrant"
zap trash: "~/.vagrant.d"
end
It has a list of all old versions too and is a simple dmg installer which you can just install over any existing version. Personally I don’t worry about upgrading Vagrant either unless I actually notice something is wrong.