Can’t install a specific version of VirtualBox via Homebrew: “Brew: Found a cask named ‘virtualbox@5.2.22’ instead”

1

I want to install a particular version of VirtualBox, namely 5.2.22, on my MacBook Pro via brew

This is the error message i got from

$ brew install virtualbox@5.2.22
Updating Homebrew...
Error: No available formula with the name "virtualbox@5.2.22"
Found a cask named "virtualbox@5.2.22" instead.

So how can I install this version in this case?

Anthony Kong

Posted 2019-05-22T03:34:02.167

Reputation: 3 117

Answers

1

Casks are installed via brew cask install so:

brew cask install virtualbox@5.2.22

jonchang

Posted 2019-05-22T03:34:02.167

Reputation: 1 246

1Now it fails with: Error: Cask 'virtualbox@5.2.22' is unavailable: No Cask with this name exists. – Ivan – 2019-12-12T23:24:11.157

1

You can do this:

cd "$(bre --repo homebrew/cask)"

brew log Casks/virtualbox.rb

That will give a list of commits and you can find which one you need. Once you find the commit you need, copy it and do

git checkout wanted_commit

For the brew install, do

HOMEBREW_NO_AUTO_UPDATE=1 brew cask install vagrant

This will get the version from the commit you checked out.

Other option is once you get the commit, you can

brew cask install https://raw.githubusercontent.com/Homebrew/homebrew-cask/wanted_commit/Casks/virtualbox.rb

Chad Malla

Posted 2019-05-22T03:34:02.167

Reputation: 11