Skip to content

Instantly share code, notes, and snippets.

@broskees
Forked from jonashackt/downgrade_brew_package.sh
Last active August 14, 2022 16:46
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save broskees/2b3c5f5969c31e7f971ffa4022d3f0da to your computer and use it in GitHub Desktop.
Save broskees/2b3c5f5969c31e7f971ffa4022d3f0da to your computer and use it in GitHub Desktop.
Downgrade homebrew (cask) package
# Uninstall current version you want to change
brew uninstall --cask vagrant
# e.g. Vagrant
brew edit --cask vagrant
# replace the contents of that file with the version of the file found in github history:
# https://github.com/Homebrew/homebrew-cask/commits/master/Casks/vagrant.rb
# or change version and SHA256, you can find on https://releases.hashicorp.com/vagrant/
```
cask 'vagrant' do
version '2.0.1'
sha256 '07f7be3a457a8422d576e6371c8499fbdea411b02aecc7ea3c5258494514c5f2'
# hashicorp.com/vagrant was verified as official when first introduced to the cask
url "https://releases.hashicorp.com/vagrant/#{version}/vagrant_#{version}_x86_64.dmg"
appcast 'https://github.com/hashicorp/vagrant/releases.atom'
name 'Vagrant'
homepage 'https://www.vagrantup.com/'
pkg 'vagrant.pkg'
uninstall script: {
executable: 'uninstall.tool',
input: ['Yes'],
sudo: true,
},
pkgutil: 'com.vagrant.vagrant'
zap trash: '~/.vagrant.d'
end
```
# Then reinstall brew package
brew reinstall --cask vagrant
# check correct version with
vagrant --version
# update and repair plugins now that you've changed versions
vagrant plugin repair && vagrant plugin expunge --reinstall
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment