This is a little script I use in various forms to keep Debian and Ubuntu machines up to date.
I usually put it in /usr/local/bin.
To keep multiple machines up to date I either set a cron job to run regularly or use cluster ssh to connect to various machines and run 'sudo update' on them.
This can be taylored to the individual machines as needed so that the same command does what I want it to.
kev.