search what port/package provides file "x"

drhowarddrfine

Son of Beastie

Reaction score: 1,227
Messages: 3,249

Don't you mean make depends? But that shows what a port depends on. He wants the reverse. Where did a file come from.
 

Chris_H

Daemon

Reaction score: 193
Messages: 1,076

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
 

drhowarddrfine

Son of Beastie

Reaction score: 1,227
Messages: 3,249

Chris_H Oh, well, wait. You're right. I confused myself. Probably cause make show-depends doesn't work on my system. Why is that?
 

Chris_H

Daemon

Reaction score: 193
Messages: 1,076

Crap! Got me. :oops:
I'm wearing far too many hats simultaneously. Sigh...

Thanks for the correction, ShelLuser !

--Chris
 

scottro

Daemon

Reaction score: 502
Messages: 1,412

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.
 

b6s6d6

Member

Reaction score: 15
Messages: 36

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.
No problem ;)
 

miklosq

New Member


Messages: 7

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
#
 
Top