The pain-free guide to switching Linux distros

Those with a distro that uses RPM packages can generate it with:
rpm --query --list >packages.txt

You can shorten the list by removing all lib* packages and those with -dev in the name, as these are generally only installed as dependencies. This produces a list on Ubuntu (there are two spaces following 'ii').
dpkg --list | grep -v -e '-dev' -e '^ii lib' >packages.txt

ls -1 /opt >binary_packages.txt

Packages you compiled from source are a little more tricky, but anything installing with ./configure && make && make install will install to /usr/local unless you mess with the PREFIX setting for ./configure.

ls -l /usr/local/bin >source_packages.txt
should catch most, if not all, self-compiled programs. With the lists stored, you can recreate the software collection on the new distro.