Question about packages installed via `pkg_add -r`
Matthew Seaman
m.seaman at infracaninophile.co.uk
Sun Mar 6 21:18:30 UTC 2011
On 06/03/2011 08:27, perryh at pluto.rain.com wrote:
> Last time I tried it, pkg_add -r -K did indeed save local copies of
> the packages fetched from the remote repository, but a problem arose
> when one later wanted to _use_ that local stash while falling back to
> -r behavior for anything not found locally. Last I knew there was no
> easy way to tell pkg_add to do that.
Interestingly, portmaster(8) is good for doing that. These two lines in
portmasterrc (or the equivalent command line options: --packages,
--local-packagedir) make portmaster try to install a package from a
local package repository first, then fall back to fetching packages from
the net, and only then try building the port:
PM_PACKAGES=first
LOCAL_PACKAGEDIR=/usr/ports/packages
Which is what you want. Or perhaps 'PM_PACKAGES=only' which only uses
pkgs and doesn't build any ports.
Personally I find these most useful combined with a third option:
PM_PACKAGES_LOCAL=pmp_local
(Cmd line: --packages-local) which makes portmaster try to install pkgs
from a local repository first, and failing that, build the port.
Oh, and to save anyone needlessly re-downloading packages: if you've got
the port / package already installed, then you can recreate the pkg
tarball easily by:
# pkg_create -b pkg-name
Add a '-R' to that to create pkg tarballs for everything pkg-name
depends on too. pkg-name will include the version number as shown in
eg. 'pkg_info -Ia' output.
Cheers,
Matthew
--
Dr Matthew J Seaman MA, D.Phil. 7 Priory Courtyard
Flat 3
PGP: http://www.infracaninophile.co.uk/pgpkey Ramsgate
JID: matthew at infracaninophile.co.uk Kent, CT11 9PW
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 267 bytes
Desc: OpenPGP digital signature
Url : http://lists.freebsd.org/pipermail/freebsd-stable/attachments/20110306/b6888a47/signature.pgp
More information about the freebsd-stable
mailing list