Update Raspbian

To upgrade and update Raspbian, enter the following from the command line:

sudo apt-get update && sudo apt-get upgrade -y

The -y means you don't have to say 'yes' to any Yes/No questions.

Update Firmware

sudo apt-get install rpi-update

Automatic Updates

If you want to automate these procedures it can be done by configuring apt's Periodic options. The Raspberry Pi comes with apt installed (it provides the apt-get commands, etc.), and as part of that package an automated script is installed (in /etc/cron.daily/apt) for doing automated updates on a daily basis (using the cron daemon). These may be controlled by creating (as root) a file /etc/apt/apt.conf.d/10periodic putting the following into it:

APT::Periodic::Update-Package-Lists "1";
APT::Periodic::Download-Upgradeable-Packages "0";
APT::Periodic::AutocleanInterval "0";
APT::Periodic::Unattended-Upgrade "0";