packages listing

Matthew Seaman matthew at
Sun Feb 10 10:56:06 UTC 2013

On 10/02/2013 06:52, Dánielisz László wrote:

> Do you have any idea how can I list those installed packages that are not required by any other?

If you're using pkgng:

   pkg query -e "%#r==0" "%n-%v"

There isn't (as far as I know) a way of doing this directly with
pkg_tools alone, so either install an appropriate tool from ports as
others have suggested elsewhere in this thread, or if you have to use
only what comes with the base system, then something like:

   cd /var/db/pkg
   ls -1 */+REQUIRED-BY | sed -e 's,/+REQUIRED-BY,,'

(untested and from memory as I don't have any pkg_tools systems any
more.)  Note: this is not necessarily entirely accurate.  The
+REQUIRED-BY files are updated by tools like portmaster(1) or
portupgrade(1) but not if you install via pkg_add(1) or by using make(1)
directly in the ports tree.



Dr Matthew J Seaman MA, D.Phil.

-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 268 bytes
Desc: OpenPGP digital signature
URL: <>

More information about the freebsd-questions mailing list