I was about to run a wipe out of my Ubuntu Karmic and fix Lucid into it. Really wanted to backup the list of installed packages and found this damn cool feature from dpkg.
dpkg --get-selections > filename
All the installed pacakges will be listed in the file.
Later, you can do
dpkg --set-selections < filename
and run dselect to install all the packages back.