Is there any way to make the simple command
sudo pkg_add some-package
work on an ordinary installation of NetBSD without recompiling anything from source code? All other Unix systems that I have tried provide an equivalent command out of the box with little effort.
The best I could think up was to add
export PKG_PATH="ftp://ftp.NetBSD.org/pub/pkgsrc/packages/$(uname)/$(uname -m)/$(uname -r)/All/"
/root/.shrc but sudo doesn't read
The pkgsrc FAQ, "Using 'sudo' with pkgsrc" says that you can adapt the "just-in-time su(1) feature of pkgsrc" to use sudo but it requires editing a makefile and recompiling something. That seems like a steep requirement for such a basic task. Even without this modification,
pkg_add doesn't ask me to
su when I try to install packages as a normal user - it just says
pkg_add: Can't create pkgdb entry: /var/db/pkg/<...>: Permission denied
OpenBSD has an /etc/installurl file for this purpose but I couldn't find an equivalent one for NetBSD.