Sign up ×
Ask Ubuntu is a question and answer site for Ubuntu users and developers. It's 100% free.

This question already has an answer here:

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.

share|improve this question

marked as duplicate by muru, A.B., Jacob Vlijm, Mitch Apr 30 at 16:52

This question has been asked before and already has an answer. If those answers do not fully address your question, please ask a new question.

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.

share|improve this answer

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>

See the man-page for dpkg for more options.

share|improve this answer

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.

share|improve this answer

Yes, its 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.
share|improve this answer

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.

share|improve this answer

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.

share|improve this answer

Not the answer you're looking for? Browse other questions tagged or ask your own question.