Re-package a vagrant box after modification
SSH into existing box and make changes
apt-get update && apt-get dist-upgrade -y && apt-get autoremove --purge -y
Update VirtualBox Guest additions
See here
Remove all MySQL databases
mysql -uroot -p -e " SHOW DATABASES;" | grep -v Database | grep -v mysql| grep -v sys | grep -v performance_schema | grep -v information_schema | gawk ' {print "drop database " $1 ";select sleep(0.1);"}' | mysql -uroot -proot
sudo apt-get autoclean
sudo rm -rf /var/log/vboxadd-install* /var/log/VBoxGuestAdditions*
# run as root, clears all log files
for logfile in ` find /var/log -name ' *.log' -type f` ; do echo ' ' > $logfile ; done
rm -rf /tmp/*
sudo dd if=/dev/zero of=/EMPTY bs=1M
sudo rm -f /EMPTY
cat /dev/null > ~ /.bash_history && history -c && exit
Halt the box and re-package:
vagrant halt
vagrant package --output /path/to/mynew.box
openssl sha1 /path/to/mynew.box
Add new version to the json catalog incl. checksum
Upload new version to server