Find FreeBSD Ports That Depend on Another Port

bsd-portsdependenciesfreebsd

I have a headless FreeBSD server where some port has installed tons of X11-related packages. I would like to find out what these ports are so I can get rid of the unwanted X-related packages. Is there a way to figure this out?

Best Answer

The current accepted answer is out of date. FreeBSD has replaced its legacy packaging tools with pkgng.

Here's the new way to query the reverse-dependencies of a package:

pkg info -r <pkg name>

Example:

root@server:/usr/ports # pkg info -r python27
python27-2.7.6_4:
        python2-2_2
        talloc-2.0.8
        tevent-0.9.18
        tdb-1.2.12,1
        ldb-1.1.16
        glib-2.36.3_2
        xcb-proto-1.9
        gobject-introspection-1.36.0_2
        samba4-4.0.13