Unix & Linux Stack Exchange is a question and answer site for users of Linux, FreeBSD and other Un*x-like operating systems. It's 100% free, no registration required.

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

AFAIK this is the way that I can install for ex.: XYZ on OpenBSD:

pkg_add -Uvi XYZ

How can I get a list for all the dependencies regarding XYZ package?

-> So I need a list about .tgz filenames that pkg_add will download/install/update when I need to install given XYZ package.

What is the command to generate a list for XYZ package?

share|improve this question
please ask if it's unclear :) – gasko peter May 8 '12 at 22:24
Why not just grab the ports tree, and check the Makefile for the ports you care about? – gabe. Jun 22 '12 at 17:48
up vote 5 down vote accepted

Looks like dependencies are specified in the packing list. You can see the packing list with pkg_info -f.

So, assuming PKG_PATH is already set:

pkg_info -f XYZ | grep '^@depend' | cut -f 3 -d :

should give you the package names.

Prepending $PKG_PATH and appending .tgz to each line should give you a URL that's probably what would be downloaded, e.g. to get bash's dependencies:

export PKG_PATH
pkg_info -f bash | grep '@depend' | cut -f 3 -d : | while read package; do
    echo $PKG_PATH$package.tgz



See also pkg_add -n and PKG_CACHE.


share|improve this answer
sqlports is simpler :) openports.se/databases/sqlports – Rufo El Magufo May 16 '12 at 1:55

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.