# pkg info on non-boot disk/partition



## balanga (Mar 18, 2020)

If I have FreeBSD installed on a disk/partition from which I am not booting, is it possible to identify which pkgs have been installed?


----------



## SirDice (Mar 18, 2020)

Not easily. You could try to chroot(8) the environment and run a pkg-info(8) from there.


----------



## T-Daemon (Mar 18, 2020)

SirDice said:


> Not easily.


Not at all.


SirDice said:


> You could try to chroot(8) the environment and run a pkg-info(8) from there.


Works nicely. Alternative method:
`setenv PKG_DBDIR /mounted_fbsd_part/var/db/pkg ; pkg info`
For PKG_DBDIR see pkg-info(8) and pkg.conf(5).


----------



## SirDice (Mar 18, 2020)

T-Daemon said:


> Not at all.


Well, technically you could load the local.sqlite database with an SQLite client and read it that way. But you would need to know how the database is structured.


----------

