5

I have installed pulseaudio-module-bluetooth using apt.

$ type pulseaudio-module-bluetooth
bash: type: pulseaudio-module-bluetooth: not found
$ which pulseaudio-module-bluetooth
$ whereis pulseaudio-module-bluetooth
pulseaudio-module-bluetooth:

Clearly, I'm looking for the wrong thing. The package does not simply install a command that is the same name as the package. Alright, then.

I want to find out what all commands (or executables) this package installed, and their locations.

The answers to "How to get information about deb package archive?" tell me how to find the files installed by the package if I have a .deb file. I'm not installing directly from a .deb file, though. I'm using apt. Where is the .deb file that that used? Is there a copy on my system somewhere that I can query with the commands in the answers to that question? Where?

If there isn't a local copy on my system, can I get one with apt? How?

Is there some handy apt (or similar) command that wraps this up for me, so that I do not have to run dpkg-deb directly? What is it?

Can I find the package's file list entirely on-line, without explicitly downloading any .deb files and before installing anything with apt? How?

JdeBP
  • 66,967
  • 12
  • 159
  • 343
Porcupine
  • 1,680
  • 2
  • 19
  • 45

3 Answers3

10

I think there is an existing answer to your question (which isn’t How to get information about deb package archive?), but I can’t find it.

To list the contents of an installed package, use dpkg -L:

dpkg -L pulseaudio-module-bluetooth

If you want to list the contents of a package before installing it, install apt-file, then run apt update, and

apt-file list pulseaudio-module-bluetooth

will list the contents of the package without downloading it or installing it.

You can also view the contents of a package from its web page; look for “list of files” links at the bottom of the page.

Stephen Kitt
  • 411,918
  • 54
  • 1,065
  • 1,164
  • On running the mentioned commands, I found that this package has only shared objects `.so` files and documentation files. So, does this means that there is no associated executable? I was expecting an executable as in the description it says that it is a sound server for POSIX systems. – Porcupine Jan 27 '19 at 17:50
  • Also, in this case how can I make sure that the installed package is working properly? In this case wether the shared objects are being identified and used by the system? – Porcupine Jan 27 '19 at 17:52
  • 2
    The sound server is PulseAudio, which is installed by the `pulseaudio` package. `pulseaudio-module-bluetooth` is a PulseAudio module. To check it’s being used, run `pactl list modules` and look for Bluetooth modules (`module-bluetooth-policy`, `module-bluetooth-discover`, `module-bluez5-discover`). – Stephen Kitt Jan 27 '19 at 17:57
0

There is a few approaches here. One of easiest is to download specific package:

cd /tmp/ && apt download pulseaudio-module-bluetooth

and list package content by:

dpkg -c pulseaudio-module-bluetooth-{version_stuff}.deb |grep bin
Radek Radek
  • 171
  • 4
  • 1
    This answer is just complicating. Dpkg - L package_name is more than enough for listing the contents of installed packages – Rui F Ribeiro Jan 27 '19 at 16:47
  • @RuiFRibeiro - But would `pkg -c ` list the contents? Would it work on a non-installed package? – sancho.s ReinstateMonicaCellio Apr 12 '20 at 06:23
  • @sancho.sReinstateMonicaCellio apt download does not install a package, only downloads it to disk. – Rui F Ribeiro Apr 12 '20 at 08:54
  • @RuiFRibeiro - Ok. Still, I did not understand from your comments (and I would appreciate clarifying) whether: 1) `dpkg -c ` would correctly list the contents of a `.deb` file. 2) it works on a non-installed package. You mention this answer "is just complicating". As I see it, this answer works just as well as the accepted answer, by listing the deb file corresponding to a package, instead of the package by its name. It may require a tiny plus of an effort... – sancho.s ReinstateMonicaCellio Apr 12 '20 at 11:20
  • @sancho IMO one complication is that this solution involves downloading the package just to list its contents. `apt-file list` doesn’t. If you have the package file already, then yes, `dpkg -c` works fine, without requiring the package to be installed. – Stephen Kitt Apr 12 '20 at 11:38
  • @StephenKitt - That is correct. I think this is the point worth remarking as the main difference with your answer. – sancho.s ReinstateMonicaCellio Apr 12 '20 at 11:49
0

You asked

I want to find out what all commands (or executables) this package installed, and their locations.

I found this answer from member Evo2 over at linuxquestions.com where he mentions a nice utility called dlocate. dlocate has a nice "-lsbin" option which does exactly that. Since you mention apt I presume you are using a debian derivative, so dlocate should be available for your distro.

For example, if I want to find all executables shipped with libreoffice7.0 I'd do :

root#ychaouche-PC 14:15:15 /opt # dlocate -lsbin libreoffice7.0
/opt/libreoffice7.0/program/minidump_upload
/opt/libreoffice7.0/program/oosplash
/opt/libreoffice7.0/program/soffice
/opt/libreoffice7.0/program/soffice.bin
/opt/libreoffice7.0/program/unoinfo
/opt/libreoffice7.0/program/unopkg
/opt/libreoffice7.0/program/unopkg.bin
root#ychaouche-PC 14:19:44 /opt #

Please bare in mind that you need to do an update-dlocate in order for dlocate to work properly.

ychaouche
  • 945
  • 8
  • 25