# How to query reverse dependencies of a package without installing it



## attilagyorffy (Jan 28, 2016)

Hi all,

I'm looking for a way to query the whole pkg database for reverse dependencies. What I'd like to find out is which one of the available packages depend on openssl in case I decided to uninstall it and replace it with libressl for example.

I have installed the openssl package, yet I was unable to query its reverse dependencies:

`pkg query %ro openssl`

This command above returned nothing which I believe is because I currently have no packages installed that depend on openssl. I need to query all available packages. How do I do this?

Thank you in advance.


----------



## marino (Jan 28, 2016)

Try pkg-rquery(8) instead.


----------



## attilagyorffy (Jan 28, 2016)

marino@ said:


> try rquery instead


Oh gotcha! Thank you for the quick response. I wasn't aware of a separation between local and remote queries. (Thought maybe an `--all` flag would help but nope...).


----------



## attilagyorffy (Jan 28, 2016)

getopt said:


> ... or see http://www.freshports.org/security/openssl/ for really all available packages.


Oh this is a good one, thank you. One thing that I've spotted is that openssl seems to be reported as a runtime dependency for 800+ packages (ports?) yet when I query the database using `pkg rquery` I get only 19 results. Why is that? Does `pkg` only offer a subset of ported software OR the list on fresh ports are all recursive dependencies?


----------



## tobik@ (Jan 28, 2016)

attilagyorffy said:


> Oh this is a good one, thank you. One thing that I've spotted is that openssl seems to be reported as a runtime dependency for 800+ packages (ports?) yet when I query the database using `pkg rquery` I get only 19 results. Why is that? Does `pkg` only offer a subset of ported software OR the list on fresh ports are all recursive dependencies?


My guess: Packages that link with base's OpenSSL are not included in pkg's list i.e. if a package links with base's OpenSSL it naturally does not need to declare a dependency on security/openssl.


----------



## kpa (Jan 28, 2016)

That's because the base system is not a pkg package, it's just a rather nebulous collection tools and libraries that the programs use but since it's not tracked by pkg the dependencies to base system libraries are not something you can query for. This might change when the base system gets packaged in (hopefully) FreeBSD 11.


----------

