How to obtain installed package files?

I need to download all packages I already installed on Ubuntu 11.10 x64. There should be in /var/cache/apt/archives I know, but there are only 300 Mb of deb files. I installed a lot of development packages that there are not there right now. I think system cleans the cache automatically!

Now I want to download all packages installed on system, else than packages that are installed by default.


Solution 1:

The following command in the terminal grabs the list of installed packages and downloads, packages will be stored at /var/cache/apt/archives

dpkg -l | grep "^ii"| awk ' {print $2} ' | xargs sudo apt-get -y --force-yes install --reinstall --download-only