which lib belongs to deb

134 views Asked by At

I can explore a given deb packets with ar –p or I can extract the contents of the deb with ar –x so that I can see the contents of the deb.

My question is vice-versa. I want to know for a given lib from which deb packets the lib stems.

Of course I could build a dummy deb which contains the lib, the install would fail and the error message would tell me in which deb the lib is. But is there an easier way?

3

There are 3 answers

4
musbach On BEST ANSWER

Only dpkg -S <filename> provides always the correct answer. Two examples:

deb which is part of the repository:

root@ReelBox60:/usr/lib# apt-file search libusbmuxd.so.2 libusbmuxd2: /usr/lib/libusbmuxd.so.2 root@ReelBox60:/usr/lib# dpkg -S libusbmuxd.so.2 libusbmuxd2: /usr/lib/libusbmuxd.so.2

local deb:

root@ReelBox60:/usr/lib# apt-file search libreelsearchapi.so root@ReelBox60:/usr/lib# dpkg -S libreelsearchapi.so libreelaudiodb: /usr/lib/libreelsearchapi.so

In this case, the local deb is not shown by apt-file search

2
Ishay Peled On

Sure,
First, run apt-file update
Then use apt-file search <filename> to see which package has it

3
musbach On

I found it! It is dpkg -S <filename>. This command searches the repository and looks into local packages.