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?

  • 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

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.


| improve this answer | |

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.