Is it possible to view the contents of a debian package? [duplicate]

Solution 1:

Use

dpkg -x somefile.deb somefolder

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

Use

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.

Solution 2:

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.

Solution 3:

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.

Solution 4:

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.

Solution 5:

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.