You have the option to just upgrade bash. To do so use the following apt-get
command:
apt-get update
Then after the update fetches all of the available updates run:
apt-get install --only-upgrade bash
To get updates on older releases, Squeeze for example, you will probably need to add the Squeeze-LTS repo to your sources.list.
To add this repository, edit /etc/apt/sources.list
and add the following line to the end of the file.
deb http://ftp.us.debian.org/debian squeeze-lts main non-free contrib
To check a particular system for the vulnerabilities (or see if the upgrade works) you can check the bash versions that you are using and see if the version is affected (it probably is) or there are numerous shell test scripts available on the web.
EDIT 1
To upgrade bash
on Lenny or Etch, take a look at Ilya Sheershoff's answer below for how to compile bash
from source and manually upgrade the version of bash
that your release is using.
EDIT 2
Here is an example sources.list
file from a Squeeze server I successfully upgraded:
deb http://ftp.us.debian.org/debian/ squeeze main
deb-src http://ftp.us.debian.org/debian/ squeeze main
deb http://security.debian.org/ squeeze/updates main
deb-src http://security.debian.org/ squeeze/updates main
# squeeze-updates, previously known as 'volatile'
deb http://ftp.us.debian.org/debian/ squeeze-updates main
deb-src http://ftp.us.debian.org/debian/ squeeze-updates main
# Other - Adding the lsb source for security updates
deb http://http.debian.net/debian/ squeeze-lts main contrib non-free
deb-src http://http.debian.net/debian/ squeeze-lts main contrib non-free
system shell
on that system? (That is, the shell you get when you run thesystem
POSIX call, which is /bin/sh). If /bin/sh is bash, then you need to update. If it's not... Then you're probably fine (but you should update bash itself anyway)