For all those people who might still googling this issue at Jan 2017, you can have some cool stuff with recent versions of apt and dpkg in Debian 8.5 without downloading anything.
List Contents of Deb File Without Download:
First locate the full url of the deb file :
root@debian:apt-get --print-uris download yade'http://httpredir.debian.org/debian/pool/main/y/yade/yade_2016.06a-7_amd64.deb' yade_2016.06a-7_amd64.deb 1621148 SHA256:26c0d84484a92ae9c2828edaa63243eb764378d79191149970926aa3ec40cdd4
PS: --print-uris switch prints the url of deb package but deb is not downloaded.
Then display contents of deb package without downloading it:
root@debian:curl -sL -o- "http://httpredir.debian.org/debian/pool/main/y/yade/yade_2016.06a-7_amd64.deb" |dpkg-deb -c /dev/stdindrwxr-xr-x root/root 0 2016-12-10 22:18 ./drwxr-xr-x root/root 0 2016-12-10 22:18 ./usr/drwxr-xr-x root/root 0 2016-12-10 22:18 ./usr/bin/-rwxr-xr-x root/root 13184 2016-12-10 22:18 ./usr/bin/yade.........................more files listed bellow ......................
PS: Same result can be achieved with
root@debian:dpkg -c <(curl -sL -o- "http://httpredir.debian.org/debian/pool/main/y/yade/yade_2016.06a-7_amd64.deb")
Extract a file from the above deb package , without download.
For example we want to read man page of package yade without installing this package and without even downloading the deb package.
Filename of man page inside deb package as advised by dpkg -c
is ./usr/share/man/man1/yade.1.gz
To read man page on the fly:
root@debian:curl -sL -o- "http://httpredir.debian.org/debian/pool/main/y/yade/yade_2016.06a-7_amd64.deb" |dpkg-deb --fsys-tarfile /dev/stdin |tar -xO ./usr/share/man/man1/yade.1.gz |man /dev/stdin
man page is displayed correctly using man application.
PS: Above pipes does not work with ar command.
root@debian:apt --version --> apt 1.4~beta2 (amd64)root@debian:dpkg --version --> Debian 'dpkg' package management program version 1.18.18 (amd64).root@debian:man --version --> man 2.7.6.1root@debian:tar --version --> tar (GNU tar) 1.29