Is there an easy way to figure out why, when I'm trying to install a certain port in FreeBSD, some other certain port is listed as a dependency?

Specifically, I'm trying to install the Webalizer port on my VPS, and along the way it's wanting to install Python. I'd really rather not install any new programming languages on the server that I'm not going to use directly. I suspect Webalyzer is (depending on something which is)+ depending on Python, and hopefully I can stop that by changing the configuration settings of one of those dependencies, but I'm not sure how to find it.

I know pkg_info can find similar information for installed ports, but I'm hoping to find this info before installation.

  • Did you try portmaster? It prints all dependencies BEFORE does anything. – uzsolt Nov 27 '13 at 7:55
  • Elaborate, please? I know that it prints a list of what it installs before it installs anything, but it's just a flat list - it doesn't show me how or why something is a dependent. – Garrett Albright Nov 29 '13 at 1:15
  • Hm, I think I understand what do you want to know. I think I can't answer :( – uzsolt Nov 29 '13 at 5:51

The ports system provides a make target to display runtime and buildtime dependencies See the ports man page.

So you should be able to use make pretty-print-run-depends-list pretty-print-build-depends-list to get a list of dependencies.

run-depends-list, build-depends-list
                  Print a list of all the compile and run dependencies,
                  and dependencies of those dependencies, by port direc-

                  Print a list of all dependencies for the port.

 pretty-print-run-depends-list, pretty-print-build-depends-list
                  Print a list of all the compile and run dependencies,
                  and dependencies of those dependencies, by port name and

 missing          Print a list of missing dependencies to be installed for
                  the port.

You can use these targets to make a shell script to follow the dependencies (this was a stupid quick hack so there is probably a better way).


printdeps() {
  local ni
  local dep
  local thisdir

  port=`basename $dir`

  cd "$dir"
  echo ${i}$dir
  for dep in `make build-depends-list` ; do
    printdeps $dep "$ni"
  cd "$thisdir"

printdeps $PWD

For webalizer you will find at least this build dependency path to python webalizer->gd->tiff->freeglut->libGLU->libGL->/usr/ports/lang/python

  • Thanks, but I already know how to get a list of dependencies for any given ports. What I want is to be able to see why one port depends on another - as in the OP, I want to know why I'm being asked to install Python when I try to install Webalizer. What is the chain of dependencies leading to that? – Garrett Albright Nov 29 '13 at 1:21
  • I added a shell script that uses those targets to follow the dependencies. – Craig Dec 2 '13 at 17:02
  • Thanks! Your script was useful (especially after piping to grep to filter the output). After seeing that gd was a common culprit, I paid more attention to the config screens and disabled most image-related things instead of just accepting the defaults, and got it to the point where it needs to install just four dependencies, and none of them are new scripting languages. It'd be great if there were some way to determine which config option led to the installation of which port, but as it is it hinted me in the right direction. – Garrett Albright Dec 2 '13 at 23:48

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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