I need to list/download all the recursive dependencies of a debian package.
Suppose i need to install package a.deb and it depends on package b.deb and again package b.d
As midihenry pointed out - install the apt-rdepends package and then run this
$ apt-rdepends gcc | awk '$1 ~ /^Depends:/{print $2}' | xargs apt-get download
this line will get all dependencies recursively and, looking at the second pipe, will download all the packages by name from the stdio, which is what the line -
awk $1 ~ /^Depends:/{print $2} does. prints out the names of packages. If you run these commands additively, you'll see what i mean.