I tried to run a simple “vagrant up” command today, and got this overly-scary error message:
“vagrant” will damage your computer. This file was downloaded on an unknown date.”
This is not my first time using vagrant on this machine. In fact, I use it all the time, so what happened? Did something get corrupted? Was I infected with malware?
Luckily, all my doomsday thinking was unnecessary. What happened was relatively innocuous and easy to fix. Hashicorp revoked the vagrant certificate (https://support.hashicorp.com/hc/en-us/articles/13177506317203) because of a CircleCI Security issue first announced on January 4th, 2023 (https://circleci.com/blog/january-4-2023-security-alert/).
To fix this, you just need to remove and reinstall vagrant. I used the following commands to do this on my Mac. This removes vagrant only and none of my user data.
Remove vagrant:
sudo rm -rf /opt/vagrant /usr/local/bin/vagrant
sudo pkgutil --forget com.vagrant.vagrant
Reinstall vagrant:
brew install hashicorp/tap/hashicorp-vagrant
If you are using something other than Mac, you can get instructions for your specific setup as well on the vagrant site:
Uninstalling vagrant: https://developer.hashicorp.com/vagrant/docs/installation/uninstallation
Reinstalling vagrant: https://developer.hashicorp.com/vagrant/downloads