Using pkgsrc as unprivileged user
From NetBSD Wiki
This article describes how pkgsrc can be used by any user with enough disk space to install third-party packages.
Bootstrapping pkgsrc
Download pkgsrc like described in the pkgsrc guide and extract it to a directory (which will be called PKGSRCDIR in the remainder of this article). Then change to a directory where you have write permissions.
$ $PKGSRCDIR/bootstrap/bootstrap --unprivileged
This will install the pkgsrc binaries into $HOME/pkg. If you don't like this decision, run ./bootstrap/bootstrap --help and see what you want to configure.
When the bootstrap has finished, you can remove the working directory:
$ rm -rf work
Add $HOME/pkg/bin and $HOME/pkg/sbin to your PATH.
That's it. pkgsrc is installed. Now it's time to install some packages.
Installing packages from source
$ cd $PKGSRCDIR/misc/screen $ bmake package clean
Unsolved problems
The pkgsrc support for unprivileged users is already very good, but not yet complete. This is due to the following problems:
- Some packages need to install their binaries set-uid root. When you are an unprivileged user, you cannot make full use of these packages.
- Some packages need separate user accounts, for example Apache. Often this is not a big problem, as you only need to tell the package that it should run under your name. (See [here] for instructions.)
