Install dependencies

$ pfexec pkg install cvs build-essential

Bootstrapping pkgsrc

Set Specify your preferred location, preferable /opt/PKGSRC You can specify a different path

$ mkdir -p /opt/PKGSRC/{usr/bin,usr/sbin} && PKGSRC_OPT_PATH='/opt/PKGSRC'
$ cd $PKGSRC_OPT_PATH; export CVS_RSH=ssh; cvs -d anoncvs@anoncvs.NetBSD.org:/cvsroot co pkgsrc

The authenticity of host 'anoncvs.netbsd.org (199.233.217.198)' can't be established.
RSA key fingerprint isSHA256:oeLj1lbu1HBb/Mc2ERoP11g8JDFnrHWvSvPTXOu9bXw.

$ cd $PKGSRC_OPT_PATH/pkgsrc/bootstrap
$ ./bootstrap
$ ./cleanup
$ export PATH=$PKGSRC_OPT_PATH/usr/bin:$PKGSRC_OPT_PATH/usr/sbin:$PATH
 
Examples install nano
$ cd /opt/PKGSRC/pkgsrc/*/nano
$ bmake

OR

$ echo "export PATH=$PKGSRC_OPT_PATH/usr/bin:$PKGSRC_OPT_PATH/usr/sbin:$PATH" >> $HOME/.profile
 
Examples install nano
$ cd /opt/PKGSRC/pkgsrc/*/nano
$ bmake