search what port/package provides file "x"

make depends makes the dependencies. Which is far from showing the dependencies. :)
So. No. I meant show-depends. But you're right in the respect that it doesn't (necessarily) show where a file came from. But my intention was to show there are other ways more powerful than pkg(7) to learn about ports -- whether already installed, or one you might want to install. make show-depends provides a great deal of information about something not installed. That pkg just can't give. You could -- if you were crazy enough; cd /usr/ports and perform a search via find(1) piping the output to grep(1), then piping that outut to make show-depends finally redirecting that output to a file. Thereby giving you all (more than) the information you could ever hope to want. :what:
But that would be crazy. There are a number of additional commands in this category that would likely be (more) helpful in finding where something came from, or why something (unwanted) got pulled in, and from where. It's all pretty well documented in make(1). :)

HTH

--Chris
 
I am finding pkg-provides to work well, and again thank b6s6d6 for recommending it. I seldom need it, (for example, in CentOS, I need it more frequently as I try to compile a 3rd party program) but it does work quite well.
 
That will only produce an error, see also pkg-info(8). The -l switch is used to list the contents of one of more packages, ergo you can't use a file as parameter.

info isn't the right command for this anyway, that would be pkg-which(8).

Correct. For sake of completeness, in case of using the pkg package management tool, the command is pkg which file-or-directory-to-search-for, like in the below example:

Code:
# locate firefox | grep bin
/usr/local/bin/firefox
/usr/local/lib/firefox/firefox-bin
# pkg which /usr/local/bin/firefox
/usr/local/bin/firefox was installed by package firefox-66.0.3,1
#
 
I have tried every iteration of what package provides nmtui. All I get is usage examples of nmtui. BTW: it doesn't appear to be networkmgr. "Google it" isn't very nice.
Afaik: nmtui is part of the GNOME Network Manager, which is "Linux only"; You can't get it for FreeBSD, and that's why you won't find a package containing it.
 
Back
Top