I've found the easiest way is to:
- download the latest version with wget http://wordpress.org/latest.zip
- unzip the archive which will extract a directory 'wordpress' eg unzip wordpress-3.4.zip
- now copy the contents of the wordpress directory over the existing installation with cp -a .../wordpress/* .../mywpinstall
Now hit the admin console and you may get a prompt to upgrade the database.
If you want a really mad upgrade script, check out the Rimu Hosting script at http://blog.rimuhosting.com/2012/06/14/wordpress-mass-update-script-3-4/