Once a package is installed, its archive file is stored locally in /var/cache/apt/archives/
.
To examine the contents of a deb
file stored there, use the following command:
dpkg -c /var/cache/apt/archives/package-name.deb
Note that this method will only work for packages that have been
installed recently.
If the package cache has been emptied since you
installed the said package, this method logically won't work.
For example, in my case, this is what the command outputs for the toilet
package:
# dpkg -c /var/cache/apt/archives/toilet_0.2-1_i386.deb
drwxr-xr-x root/root 0 2010-05-12 18:21 ./
drwxr-xr-x root/root 0 2010-05-12 18:21 ./usr/
drwxr-xr-x root/root 0 2010-05-12 18:21 ./usr/bin/
-rwxr-xr-x root/root 14096 2010-05-12 18:21 ./usr/bin/toilet
drwxr-xr-x root/root 0 2010-05-12 18:21 ./usr/share/
drwxr-xr-x root/root 0 2010-05-12 18:21 ./usr/share/man/
drwxr-xr-x root/root 0 2010-05-12 18:21 ./usr/share/man/man1/
-rw-r--r-- root/root 1559 2010-05-12 18:21 ./usr/share/man/man1/toilet.1.gz
drwxr-xr-x root/root 0 2010-05-12 18:21 ./usr/share/doc/
drwxr-xr-x root/root 0 2010-05-12 18:21 ./usr/share/doc/toilet/
-rw-r--r-- root/root 164 2010-02-08 20:03 ./usr/share/doc/toilet/README
-rw-r--r-- root/root 174 2010-02-08 20:03 ./usr/share/doc/toilet/TODO
-rw-r--r-- root/root 708 2006-11-15 22:11 ./usr/share/doc/toilet/copyright
-rw-r--r-- root/root 9601 2010-02-08 20:22 ./usr/share/doc/toilet/changelog.gz
-rw-r--r-- root/root 346 2010-02-08 19:50 ./usr/share/doc/toilet/NEWS.gz
-rw-r--r-- root/root 428 2010-02-08 20:34 ./usr/share/doc/toilet/changelog.Debian.gz
lrwxrwxrwx root/root 0 2010-05-12 18:21 ./usr/bin/figlet-toilet -> toilet
lrwxrwxrwx root/root 0 2010-05-12 18:21 ./usr/share/man/man1/figlet-toilet.1.gz -> toilet.1.gz
If you wish to exclude directories from the output, simply append | grep -v "^d"
to the end of the command.
# dpkg -c /var/cache/apt/archives/toilet_0.2-1_i386.deb | grep -v "^d"
-rwxr-xr-x root/root 14096 2010-05-12 18:21 ./usr/bin/toilet
-rw-r--r-- root/root 1559 2010-05-12 18:21 ./usr/share/man/man1/toilet.1.gz
-rw-r--r-- root/root 164 2010-02-08 20:03 ./usr/share/doc/toilet/README
-rw-r--r-- root/root 174 2010-02-08 20:03 ./usr/share/doc/toilet/TODO
-rw-r--r-- root/root 708 2006-11-15 22:11 ./usr/share/doc/toilet/copyright
-rw-r--r-- root/root 9601 2010-02-08 20:22 ./usr/share/doc/toilet/changelog.gz
-rw-r--r-- root/root 346 2010-02-08 19:50 ./usr/share/doc/toilet/NEWS.gz
-rw-r--r-- root/root 428 2010-02-08 20:34 ./usr/share/doc/toilet/changelog.Debian.gz
lrwxrwxrwx root/root 0 2010-05-12 18:21 ./usr/bin/figlet-toilet -> toilet
lrwxrwxrwx root/root 0 2010-05-12 18:21 ./usr/share/man/man1/figlet-toilet.1.gz -> toilet.1.gz