Skip to content

Instantly share code, notes, and snippets.

@JeffreyVdb
Last active August 29, 2015 14:01
Show Gist options
  • Save JeffreyVdb/3c0a6ec558e0bb921272 to your computer and use it in GitHub Desktop.
Save JeffreyVdb/3c0a6ec558e0bb921272 to your computer and use it in GitHub Desktop.
Vagrant lucid base box scripts
#!/bin/bash
# exit script if not run as root
if [[ $EUID -ne 0 ]]; then
cat <<END
you need to run this script as the root user' >&2
use :privileged => true in Vagrantfile
END
exit 1
fi
# optimize apt sources to select best mirror
perl -pi -e 's@^\s*(deb(\-src)?)\s+http://us.archive.*?\s+@\1 mirror://mirrors.ubuntu.com/mirrors.txt @g' /etc/apt/sources.list
# update repositories
apt-get update
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment