Download package with all dependencies.

pkg-install(8) should be able to handle that for you, look into the -F ('fetch only') parameter.
Hmmm, sorry but I forgot to note that I want to download the packages + dependencies for use off-line.

This because some computers do not have internet access and the idea is to use one connected to download the packages+dependencies, copy on usb stick and paste it to the no-connected computers.

Is it possible ?

Thanks.
 
Of course it's possible. On the target machines, simply run pkg(8) with a local path and complete filename (that is with the extension included).
# cd /local/package/repository
# pkg add ./package-vers.i.o.n.txz
And that will install the package and all its dependencies as if it was installed remotely using # pkg install package-vers.i.o.n
 
Of course it's possible. On the target machines, simply run pkg(8) with a local path and complete filename (that is with the extension included).
# cd /local/package/repository
# pkg add ./package-vers.i.o.n.txz
And that will install the package and all its dependencies as if it was installed remotely using # pkg install package-vers.i.o.n
Perfect.

Thanks.
 
pkg.conf(5):
PKG_CACHEDIR: string
Specifies the cache directory for packages. Default: /var/cache/pkg

So... # echo "PKG_CACHEDIR: /local/package/repository" >> /usr/local/etc/pkg.conf.

EDIT: I guess setting it in the environment should also work, but I've never tried it.
 
Anybody stumbling on this post should take a look at pkg-fetch(8) which already was around at the creation of the post, and should have been the answer.

% pkg fetch -o ~/destdir -d pkg-name

That will download pkg-name and all dependencies into ~/destdir/All.
 
Back
Top