File:  [NetBSD Developer Wiki] / wikisrc / pkgsrc / how_to_save_your_packages.mdwn
Revision 1.1: download - view: text, annotated - select for diffs
Sun Nov 20 20:28:27 2011 UTC (11 years, 2 months ago) by mspo
Branches: MAIN
CVS tags: HEAD
import a bunch of pkgsrc articles from the old wiki

You can easily save all of your currently installed NetBSD packages for use on other machines by using pkg_tarup. Here's what to do.

1. Install pkg_tarup from pkgsrc. ie.. cd /usr/pkgsrc/pkgtools/pkg_tarup ; make install (as root)
2. Now you can now use pkg_tarup to create a tarball package from any currently installed package. Just do pkg_tarup [packagename] 

Here is an example of how powerful this technique can be. With only a few lines of shell code we can put all the installed packages into a directory:
cd /var/tmp
mkdir packages
cd packages
for PKGNAME in `pkg_info -e "*" | sort`; do
    echo "Packaging $PKGNAME"
    pkg_tarup -d "." "$PKGNAME" || echo "WARNING: Packaging $PKGNAME failed." 1>&2

CVSweb for NetBSD wikisrc <> software: FreeBSD-CVSweb