i screwed my system by changing file permissions recursively from the root folder

and want to install ubuntu new now - without all the work of going through the package list and pick all the useful packages again.
i found out that i can get a list with 'dpkg -l' but failed when i wanted to store that in a file - nor do i know how to tell dpkg later to install all these packages again.
help would be much appreciated
mandavi