Unix & Linux Stack Exchange is a question and answer site for users of Linux, FreeBSD and other Un*x-like operating systems. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

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?

share|improve this question
up vote 4 down vote accepted

pkg_info answers questions like this. With the -R option it expects a name of an installed port and will display all ports that depend on that port:

pkg_info -R libXfont-1.4.3,1

You can use wildcards to avoid specifying the name with the version number:

pkg_info -R libXfont-\*

Note that this does not work recursively, and thus you need to do pkg_info -R again for each port in the resulting list until you get to the bottom of things.

Note that on servers it is often a good idea to put the following in /etc/make.conf:


That will make most (all?) ports to skip dependencies to any X11 related stuff.

share|improve this answer
Lovely! Thanks. – Chinmay Kanchi Aug 6 '11 at 17:17
@ChinmayKanchi: In this community proper etiquette for expressing thanks is to upvote and accept answers. Since everything is kept as a permanent archive of question/answer pairs you don't need to clutter things up with thank you notes. Comments should only be used to add to or discuss the content of posts. – Caleb Aug 7 '11 at 7:08

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>


root@server:/usr/ports # pkg info -r python27
share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.