Translations:Pkgsrc in PC-BSD®/4/en

From PC-BSD Wiki
Jump to: navigation, search
  1. Obtain the NetBSD pkgsrc tree by the following commands:
    # ftp ftp://ftp.NetBSD.org/pub/pkgsrc/current/pkgsrc.tar.gz
    # tar -xzf pkgsrc.tar.gz -C /usr
  2. Bootstrap pkgsrc. FreeBSD stores its ports pkg database in /var/db/pkg/. It is therefore recommended to use /var/db/pkgsrc/ with the --pkgdbdir flag as below:
    # cd /usr/pkgsrc/bootstrap/
    # ./bootstrap --pkgdbdir /var/db/pkgsrc
  3. The NetBSD pkg tools and FreeBSD pkg tools have identical names. It is recommended to change the name of the NetBSD set to match 'bmake' by prepending a 'b' to each, as follows:
    # cd /usr/pkg/sbin/
    # mv pkg_add bpkg_add
    # mv pkg_create bpkg_create
    # mv pkg_delete bpkg_delete
    # mv pkg_info bpkg_info
  4. If the FreeBSD ports tools will not be used, they can be moved out of the way entirely, as follows:
    # cd /usr/sbin/
    # mv pkg_add pkg_add.orig
    # mv pkg_create pkg_create.orig
    # mv pkg_delete pkg_delete.orig
    # mv pkg_info pkg_info.orig
  5. Add the location of bmake (/usr/pkg/bin) and NetBSD pkg tools (/usr/pkg/sbin) to the user's search path variable. Edit the file .cshrc in the user's home directory to modify the following line:
    set path = (/sbin /bin /usr/sbin /usr/bin /usr/games /usr/local/sbin /usr/local/bin /usr/pkg/sbin /usr/pkg/bin $HOME/bin)
  6. Add the PKG_PATH definition for the latest collection of pkgsrc packages (5.1_2011Q4) to the user's .cshrc file with the following line:
    setenv PKG_PATH ftp://ftp.netbsd.org/pub/pkgsrc/packages/NetBSD/`uname -m`/5.1_2011Q4/All/
  7. Obtain the vulnerabilities file:
    # /usr/pkg/sbin/pkg_admin -K fetch-pkg-vulnerabilities
    This prevents the non-fatal error below:
    WARNING: No /var/db/pkg/pkg-vulnerabilities file found.
    WARNING: To fix run: `/usr/sbin/pkg_admin -K /var/db/pkg fetch-pkg-vulnerabilities'.
  8. The vulnerabilities of some ports (ie Firefox) may prevent them from being built. An example mk.conf file will be placed in /etc/mk.conf.example file when you use the bootstrap script. Adjust /usr/pkg/etc/mk.conf to allow vulnerable programs to be built by adding the following line:
    ALLOW_VULNERABLE_PACKAGES=TRUE
Personal tools

Variants
Actions
Navigation
Toolbox