Thanks to: http://askubuntu.com/questions/237713/is-it-possible-to-do-an-unattended-silent-lamp-installation
Example that installs Apache 2, PHP 5, MySQL, the Java JDK, NetBeans, and C++. Where PASSWORD needs to be your MySQL password (found that here):
#!/bin/sh apt-get update apt-get -y install apache2 apt-get -y install php5 libapache2-mod-php5 /etc/init.d/apache2 restart echo mysql-server-5.1 mysql-server/root_password password PASSWORD | debconf-set-selections echo mysql-server-5.1 mysql-server/root_password_again password PASSWORD | debconf-set-selections apt-get install -y mysql-server echo '' >/var/www/phpinfo.php apt-get -y install openjdk-6-jdk openjdk-6-jre apt-get -y install libnb-platform12-java apt-get -y install libnb-platform12-java-doc mget http://download.netbeans.org/netbeans/7.1.2/final/bundles/netbeans-7.1.2\ -ml-linux.sh #Clean out /tmp... sudo rm -rf /tmp/* cd /tmp #Update this line to reflect newer versions of Netbeans or replace 'javase with 'javaee' or add jee manually via #Netbeans 'plugins as needed. wget http://download.netbeans.org/netbeans/7.1.2/final/bundles/netbeans-7.1.2-\ ml-linux.sh sh /tmp/netbeans-7.1.2-ml-linux.sh --silent #Add Netbeans launcher to your PATH. Doing so allows you to run 'netbeans' command from the terminal ln -s /usr/local/netbeans-7.1.2/bin/netbeans /usr/local/bin/ #C++ apt-get -y install build-essential apt-get -y install synaptic exit 0