I want to see the contents of a debian package, especially if the package is properly cleaning up whatever it installs.

I want to also see how it goes about installing the software, what directories it creates, symbolic links etc.


6 Answers 6



dpkg -x somefile.deb somefolder

to extract the file that somefile.deb contains into folder somefolder


dpkg -e somefile.deb somefolder

to extract the control data (package scripts, metadata,...) of somefile.deb into folder somefolder.

Some archive manager let you just browser Debian packages like any other archive file.


You can use dpkg in a terminal to see which files are in an installed package.

dpkg -L <package>

You can also use it to find out which package a specific file came from.

dpkg -S <file>

To list the content of a .deb-file.

dpkg -c <file.deb>

In order to evaluate what pre/post-install actions are taken these files need to be extracted and manually viewed.

dpkg -e <file.deb> [folder] 

See the man-page for dpkg for more options.


There is dpkg -c package.deb, which lists the files installed by the package, and dpkg --info package.deb, which shows general information including which configuration scripts exist (these are run at various points during installation).

In addition, it is rather difficult for a .deb package to not clean up installed files, because these are tracked automatically, except for files created from scripts. Debian has the piuparts service, which tests this automatically for packages in the Debian archive.


Yes it is. A Debian package is in fact only an archived folder. So you should be able to open it with the default Archive Manager (right click -> Open with Archive Manager ). Optionally, you can also extract wherever you want. I hope you will be able to learn a lot from doing so.


Yes, it's just a normal AR archive, like tar part in tar.gz files (Tape ARchive in that case)

Contents of this archive are three files:

  • debian-binary: deb format version number. This is "2.0" for current versions of Debian.
  • control.tar.gz: all package meta-information. It tells dpkg what to configure when the package is being installed. data.tar, data.tar.gz, data.tar.bz2, data.tar.lzma or data.tar.xz: the actual installable files.
  • The debian-binary file must be the first entry in the archive, otherwise it will not be recognized as a Debian package.

You can see this for yourself with ar t yourpackage.deb.


For installed packages you can see a list of the directories and files it creates as well as the scripts that are used for installation and removal in /var/lib/dpkg/info. All the files are named based on the package. Various extensions indicate the files purpose.

These files can also be found in the .deb which can be viewed with an archive viewer. I tend to use mc from the command line.

Not the answer you're looking for? Browse other questions tagged .