Setting up NetBSD workstation for PKGSRC

Help edit wiki
Table of Contents

Prerequisites

  • NetBSD [-stable/-current]installed
  • Possibly a src source tree, only some rare packages needs it. If you choose not to checkout src, simply create a /usr/src directory so mksandbox doesn't complain about non-existing directory.[ref: https://wiki.netbsd.org/tutorials/pkgsrc/pbulk/]

“Only the paranoid survive.”

― Harold Finch
NetBSD VPS , NetBSD , OS108

Installing mksandbox

# sudo pkgin install mksandbox

or using pkgsrc
# cd /usr/pkgsrc/pkgtools/mksandbox/ && sudo make install

Top

“Only the paranoid survive.”

― Harold Finch
NetBSD VPS , NetBSD , OS108

Making sandbox using mksandbox

First create a folder using mkdir which you want to use as sandbox

$ mkdir /home/$user/mysandboxfolder

then use following to make that folder sandbox
$ sudo mksandbox --without-src --without-pkgsrc --without-xsrc mysandboxfolder

Top

“Only the paranoid survive.”

― Harold Finch
NetBSD VPS , NetBSD , OS108

Using sandbox to test pkgsrc port/package within sandbox

Now go into that dir and setup sandbox as follows

$cd /home/$user/mysandboxfolder
$sudo ./sandbox mount
$sudo ./sandbox

now you will see # at prompt means you have entered sandbox now fetch pkgsrc -stable branch into sandbox

#cd /usr && cvs -q -z2 -d anoncvs@anoncvs.NetBSD.org:/cvsroot checkout -r pkgsrc-2020Q4 -P pkgsrc
for getting various other branches and updating click here

After this you should be able to see pkgsrc under your sandbox now fetch WIP pkgsrc branch for that you will need to make git under sandbox:

#cd /usr/pkgsrc/devel/git && make install
#cd /usr/pkgsrc/ && git clone git://wip.pkgsrc.org/pkgsrc-wip.git wip

now you can port or import new applications under sandbox.
If you want to build your own repo under sandbox using pbulk click here for more info.

Top

“Only the paranoid survive.”

― Harold Finch
NetBSD VPS , NetBSD , OS108

Jay changed the title to NetBSD Porter's wiki .