How can i list all the files (and their future locations) which will be installed by invoking 'dpkg -i' on a .deb file? Which makefile target of the source package determines those (is it the default 'install' target?)

(The second part of the question concerns the package creation process. I want the list of files installed by 'make install' and the list of files installed by the .deb package to be the same)


2 Answers 2


You can list the contents of a deb file by running

dpkg-deb --contents package.deb

dpkg-deb can show a whole lot of information about a deb package. You can see the other options by running dpkg-deb --help.

Unfortunately, you can't determine what files a Makefile will install. However, you can install to a temporary directory by setting the DESTDIR variable. Note that this works well mainly on Makefiles generated by autotools ie. the ./configure script. For example:

cd sourcecode-1.2
./configure --prefix=/usr           #Just the usual compiling stuff
mkdir /tmp/installedfiles           #Create a temporary directory for the files
make DESTDIR=/tmp/installedfiles install

That last make line will install the files in /tmp/installedfiles. You can then see the files that would be created, although those files and directories will all be relative to the prefix specified in the configure script. In other words, /tmp/installedfiles/bin/mainprogram would be installed as /usr/bin/mainprogram.

I hope I answered your question :)

  • Okay but what determines the files which will be installed? I noticed a difference between the list of files installed using 'make install' and files which are installed by dpkg -i on the package built with the source
    – Juliusz
    Jul 6, 2011 at 5:08
  • If you install the deb, only the files and folders shown in dpkg-deb --contents will be installed. If you run make install, only the files listed in /tmp/installedfiles will be installed. How was the list different between the two? Could you edit your question and add that? Also, could you post the package you are referring to? Jul 6, 2011 at 6:00
  • I am trying create a package with a custom build (custom ./configure options) of gnash. See updated question.
    – Juliusz
    Jul 6, 2011 at 6:31
  • When you create your DEB file, try setting the configure options in the debian/rules file like this paste.ubuntu.com/638925 Jul 6, 2011 at 15:26
  • 1
    Also, if all you want is to edit the configure options, just download the source from the Ubuntu repo with apt-get source gnash and change your configure options in debian/rules starting from line 34. Jul 6, 2011 at 15:28

A deb file is an archive file which you can extract to see its contents.

From Wikipedia

Since Debian 0.93, a deb file is implemented as an ar archive. Canonical 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.

  • 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.

So when you extract a deb file you will get a data file i.e data.tar/data.tar.gz/data.tar.lzma/data.tar.xz. Extract this file and you will get all the files/directories that this deb will create or put files into.

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