While FAI and similar systems are helpful in an enterprise environment, (and he should know about them), they're unfortunately not a panacea.
For instance, what if he is working on remote machines, perhaps hosted, rented servers, colocated servers without a trusted or dedicated network, or a cloud environment like EC2? No sort of PXE netboot will work there. Puppet and Chef seem to be more general purpose tools that could help him, however.
cat << EOF | DEBIAN_FRONTEND=noninteractive DEBCONF_DB_FALLBACK=Pipe /usr/bin/apt-get install somepackage
Name: ...
Template: ...
Value: ...
Owners: ...
Variables:
....
....
EOF
You can get the correct values from the debconf DB on a system that's already been set up. This technique lets you stick the whole thing in a single shell script. For example, from /var/cache/debconf/passwords.dat (note the ability to work with both 5.0 on Debian and 5.1 and Ubuntu, extra entries don't hurt anything):
cat << EOF | DEBIAN_FRONTEND=noninteractive DEBCONF_DB_FALLBACK=Pipe /usr/bin/apt-get -qq -y install mysql-server
Name: mysql-server/root_password
Template: mysql-server/root_password
Value: YOURPASSWORD
Owners: mysql-server-5.1
Flags: seen
Name: mysql-server/root_password_again
Template: mysql-server/root_password_again
Value: YOURPASSWORD
Owners: mysql-server-5.1
Flags: seen
Name: mysql-server/root_password
Template: mysql-server/root_password
Value: YOURPASSWORD
Owners: mysql-server-5.0
Flags: seen
Name: mysql-server/root_password_again
Template: mysql-server/root_password_again
Value: YOURPASSWORD
Owners: mysql-server-5.0
Flags: seen
EOF
Another method, perhaps easier: (gather answers from debconf-get-selections or debconf-show from the debconf-utils package):
echo "Installing MySQL 5.0.."
sudo apt-get install -qqy debconf-utils
cat << EOF | debconf-set-selections
mysql-server-5.0 mysql-server/root_password password YOURPASSWORD
mysql-server-5.0 mysql-server/root_password_again password YOURPASSWORD
mysql-server-5.0 mysql-server/root_password seen true
mysql-server-5.0 mysql-server/root_password_again seen true
EOF
/usr/bin/apt-get -y install mysql-server-5.0 mysql-server
After you run debconf-set-selections, check your answers:
cat /var/cache/debconf/passwords.dat
And, while testing, be sure to remove and purge all databases (especially the mysql database, where this is stored) and fix your config DB in case they got corrupted:
apt-get --purge remove mysql-server*; /usr/share/debconf/fix_db.pl
A few tips with this:
1) You MUST have the seen flag and the _again password.
2) You MUST not put quotes around the password. It will go into a MySQL query unquoted, so you have to quote it yourself if needed. That also means no spaces (I think)
3) If you have trouble, do the preseeding by hand and then run the MySQL install directly yourself (in a normal terminal/tty) and see what debconf tells you. It will tell you warnings and errors there.