sudo cp /etc/apt/sources.list /etc/apt/sources.list.broken sudo sed -i -re 's/([a-z]{2}\.)?archive.ubuntu.com|security.ubuntu.com/old-releases.ubuntu.com/g' /etc/apt/sources.list sudo apt-get update
Here is an example for Debian Squeeze:
nano /etc/apt/sources.list
deb http://archive.debian.org/debian squeeze main deb http://archive.debian.org/debian squeeze-lts main deb http://archive.debian.org/debian-backports squeeze-backports main
The second line will fail with an "expired" type message, so you also need to add the following in /etc/apt/apt.conf (create it if it doesn't already exist):
nano /etc/apt/apt.conf
Acquire::Check-Valid-Until false;