Skip to content

Instantly share code, notes, and snippets.

@wyanez
Created January 9, 2011 18:25
Show Gist options
  • Save wyanez/771880 to your computer and use it in GitHub Desktop.
Save wyanez/771880 to your computer and use it in GitHub Desktop.
[bash]Script de Instalación de VirtualBox
#!/bin/bash
#
# Script de Instalación de VirtualBox
# William Yanez - actualizado al 09-01-2011
#
# Uso: ./instalar_virtualbox.sh VERSION DISTRO
#
if [ -z "$1" ]; then
VERSION="4.0"
else
VERSION=$1
fi;
if [ -z "$2" ]; then
DIST="lucid"
else
DIST=$2
fi;
echo "Comenzando Instalación de Virtual Box $VERSION para $DIST"
COUNT_VB=$(grep -c virtualbox /etc/apt/sources.list)
if [ "$COUNT_VB" -gt 0 ]; then
echo "Ya existe en /etc/apt/sources.list el repositorio de virtualbox"
else
echo "deb http://download.virtualbox.org/virtualbox/debian $DIST contrib">>/etc/apt/sources.list
fi;
wget -q http://download.virtualbox.org/virtualbox/debian/oracle_vbox.asc -O- | sudo apt-key add -
sudo apt-get update
sudo apt-get install -y virtualbox-$VERSION
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment