How to find which package provides a specific file or library in Freebsd 11.3

How to find which package provides a specific .so file or library in Freebsd 11.3?
I want to find the package of few .so files, which are part of a .tgz file build on FreeBSD11.3 using pyinstaller.
for instance, libkvm.so.7 is one .so file found in my .tgz file. i want to understand the which package it belongs to. I guess, there should be some command for the same
Thanks in advance
 
libkvm.so.7 is a kernel memory interface and provided by the system but in general you can try pkg which <file-path>. You can also try pkg list | grep <regexp> if you don't know the exact path. If neither yields anything, likely it is part of the FreeBSD distribution or something installed manually. Another hint: if you have a library lib<foo>.so.x, check if there is a man page by doing man <foo> or apropos <foo>.
 
pkg which example:
Code:
tingo@kg-core2$ pkg which `locate libkvm.so.7`
/lib/libkvm.so.7 was not found in the database
/usr/lib32/libkvm.so.7 was not found in the database
Anything installed via ports / packages should be under /usr/local/.. so if it isn't it is part of the base system (or someone installed manually and didn't follow the rules ..)
A better example:
Code:
tingo@kg-core2$ pkg which `locate libssl.so.11`
/usr/local/lib/libssl.so.11 was installed by package openssl-1.1.1k_1,1
Hope this helps.
 
Back
Top