EDIT: script updated to work on _STABLE
too.
It need not be. Since you're running NetBSD in a VM, just redo the install, but this time skip the pkgsrc
and pkgin
steps. After install finishes, login to the installed system as root and run the script below first thing. Then, you can use pkgin
to install packages.
#!/bin/sh
set -eux
D="PKG_DBDIR=/usr/pkg/pkgdb"
M=$(uname -m) # arch.
R=$(uname -r) # release
R=${R%%_*} # strip `_whatever'
# Ensure install is pristine.
test \! -r /etc/mk.conf
test \! -r /etc/pkg_install.conf
test \! -d /usr/pkg/etc
# Ensure the new `/usr/pkg/pkgdb' dir. is used by everything.
echo "$D" >> /etc/mk.conf
echo "$D" >> /etc/pkg_install.conf
mkdir -p /usr/pkg/etc
echo "$D" >> /usr/pkg/etc/pkg_install.conf
# Install pkgin(1) first.
PKG_PATH="https://cdn.NetBSD.org/pub/pkgsrc/packages/NetBSD/$M/$R/All"
export PKG_PATH
pkg_add pkgin
# Update pkgin(1) database.
pkgin update
# Remove obsolete dir. This *should* succeed if everything went OK.
rmdir /var/db/pkg || { echo "$0: procedure failed."; exit 1; }
And, use the latest -STABLE
images nstead of -RELEASE
: they're quite stable, and have all the important fixes. I just tried this with 9.2-RELEASE & 9.2_STABLE on real HW and had no issues.