Download package with all dependencies.

OP
C

cricket

New Member


Messages: 5

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.
 

Beastie

Daemon

Reaction score: 542
Messages: 2,275

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
 
OP
C

cricket

New Member


Messages: 5

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.
 
OP
C

cricket

New Member


Messages: 5

pkg-install(8) should be able to handle that for you, look into the -F ('fetch only') parameter.

Hello.

Is it possible to define a directory where to store the packages.
Something like this (or a other way) ? :

Code:
pkg-install -F thepackage.txz -dir /my/directory

Thanks.
 

Beastie

Daemon

Reaction score: 542
Messages: 2,275

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.
 

ucc

New Member


Messages: 11

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.
 
Top