Let's say you want to do a fresh install of Ubuntu (or Debian) and you want to install all the packages you currently have installed on the fresh installation.
The first method of doing this is very easy: