Determine destination location of apt-get install <package>?

You can run the command dpkg -L package to list all the files in the package. For example dpkg -L ubuntu-minimal will only list a couple of small files related to packaging, as it is only an empty meta-package that depends on other packages.

dpkg -L tomcat7

is probably what you want.


You can list the contents of an installed package with the dpkg command, which is the low-level package manipulation command that the APT tools call internally:

dpkg -L tomcat7

You may want to search in the output; use the grep command. For example, to see the configuration files (which live under /etc):

dpkg -L tomcat7 | grep /etc

The files you want to modify may be in dependencies of the main tomcat7 package. Searching inside a package and its dependencies is more complicated. It's likely that the files you're looking for are in some package called tomcat7-something. The easiest way to display them is with the apt-file command, which is not installed by default (install it with apt-get install apt-file).

apt-file list tomcat7

apt-file lists file names in all packages in Ubuntu (according to the package sources you have enabled), whether they are installed or not. You can also use it to search for a file:

$ apt-file search RequestInfoExample.java
tomcat7-examples: /usr/share/tomcat7-examples/examples/WEB-INF/classes/RequestInfoExample.java

What I usually do is:

  • Start Synaptic (you will need to install it first)

  • find the package I'm interested in

  • right click, select Properties

  • view the list of installed files