559

I want to know where I can find my installed application when I installed it on Ubuntu using package manager.

I installed RabbitMQ and ran locate rabbitmq which gave me following result:

/home/anupamg/.m2/repository/com/rabbitmq
/home/anupamg/.m2/repository/com/rabbitmq/amqp-client
/home/anupamg/.m2/repository/com/rabbitmq/amqp-client/1.7.2
/home/anupamg/.m2/repository/com/rabbitmq/amqp-client/1.7.2/_maven.repositories
/home/anupamg/.m2/repository/com/rabbitmq/amqp-client/1.7.2/amqp-client-1.7.2.jar
/home/anupamg/.m2/repository/com/rabbitmq/amqp-client/1.7.2/amqp-client-1.7.2.jar.lastUpdated
/home/anupamg/.m2/repository/com/rabbitmq/amqp-client/1.7.2/amqp-client-1.7.2.jar.sha1
/home/anupamg/.m2/repository/com/rabbitmq/amqp-client/1.7.2/amqp-client-1.7.2.pom
/home/anupamg/.m2/repository/com/rabbitmq/amqp-client/1.7.2/amqp-client-1.7.2.pom.lastUpdated
/home/anupamg/.m2/repository/com/rabbitmq/amqp-client/1.7.2/amqp-client-1.7.2.pom.sha1
/home/anupamg/Downloads/rabbitmq-server-generic-unix-2.4.0.tar.gz
Flyk
  • 1,480
Anupam Gupta
  • 5,713
  • What application? Some are accesible through commandline, others get an pretty icon in the application menu. Be more specific. – Ragnar123 Mar 29 '11 at 09:59
  • Do you want to know where the executables and config files reside or do you want to execute it and don't know how? –  Mar 29 '11 at 10:02
  • ok!!! i actually want to know that as in windows if i install application i can see it in program files similarly in ubuntu where to locate the installed application...I just installed RabbitMq and want to know where it is residing i need to configur its run.sh file –  Mar 29 '11 at 10:03
  • @ das_weezul :- yes I want to know all things which are done to my box when i click install from synaptic package manager ...i am a newbie on ubuntu... so any links are welcomed –  Mar 29 '11 at 10:06
  • 1
    One of the answers suggests the following dpkg-query -c <package_name.deb> You cannot do that to a deb file. I suspect the poster meant to use dpkg-deb with the same params dpkg-deb -c <filename.deb> Which lists the files as expected. – gazhay Oct 17 '14 at 14:17
  • Linux packages often install files all over the place, unlike windows where it's mostly in Program Files and some in Users. This is why it's important to use a package manager, it keeps track of all these files. If you only want to find the executable you can do which rabbitmq. – Rolf May 14 '18 at 09:43

6 Answers6

840

To see all the files the package installed onto your system, do this:

dpkg-query -L <package_name>

To see the files a .deb file will install

dpkg-deb -c <package_name.deb>

To see the files contained in a package NOT installed, do this once (if you haven't installed apt-file already:

sudo apt-get install apt-file
sudo apt-file update

then

apt-file list <package_name>

See this question for more

41

dpkg -L <package_name> might be the best for your immediate problem, but you might like to read the Filesystem Hierarchy Standard, which describes where different types of files live in the filesystem.

It is not definitive; it is just a descriptive account of the way things "mostly" are.

More specific to Ubuntu is the Ubuntu Server Guide, which will describe everything in enough detail. (So many of the other guides gloss over too many of the details, but this should be better.)

Melebius
  • 11,431
  • 9
  • 52
  • 78
sarnold
  • 1,841
  • 17
  • 20
23

if you just want a single installed package, you can find the package name

$ apt-cache search rabbitmq
...
librabbitmq-dev
...

then use dpkg --listfiles

$ dpkg --listfiles librabbitmq-dev
/usr/lib/x86-64/librabbit... 
. . . 
19

The answer given by @Gilles is very useful (actually, the answer was improved over time).

Furthermore, I have a tip for the ones that don't want to install any auxiliary package (like the apt-file):

  • Go to http://packages.ubuntu.com/;
  • Go to the Search package directories session;
  • Insert your package name in the Keyword field and select Only show exact matches;
  • Select your distribution and click in the Search button.
  • Select the desirable package in the next screen;
  • In the end of page, click in the list of files link next to your architecture name;
  • The next page will show the list of files of your package.

As an example: http://packages.ubuntu.com/trusty/amd64/multipath-tools/filelist

  • 5
    curl -s https://packages.ubuntu.com/$(lsb_release -cs)/$(dpkg --print-architecture)/<<PACKAGE NAME>>/filelist | sed '1,/pfilelist/d;/<\/div>/,$d' :-) – Nicolas Melay Aug 28 '18 at 23:57
  • Hah! Thanks for the tip. I was using dpkg -L on a metapackage and surprised that there were so few files in it (and baffled why I had literally thousands of files that I knew that belonged to that package). When I went to the Ubuntu packages directory, I immediately figured out that there were way more files beyond those in the metapackage... – Gwyneth Llewelyn Apr 01 '20 at 19:15
4

Here's one way to do it for packages you don't have installed yet. Just change "autoconf" below for the package you are trying to get the list of files for:

mkdir tmp
cd tmp
apt-get download autoconf
ar x *.deb
tar tf data.*
cd ..
rm -r tmp
Jake
  • 250
  • Due to https://unix.stackexchange.com/questions/669004/zst-compression-not-supported-by-apt-dpkg , using tar like this is useful to explore a package which isnt installed yet. – John Vandenberg Jun 22 '22 at 10:15
1

Use the synaptic-package-manager:

enter image description here

Assuming that we'd like to locate the files of the autotools-dev package, under 'Quick filter' enter autotools-dev to locate it. The autotools-dev package appears automatically. Select it by clicking on it and then press 'Properties'. In the appearing dialog, select the tab 'Installed Files'.