According to NetBSD's wiki I can use pkg_add -uu to upgrade packages. However, when I attempt to use pkg_add -uu it results in an error.

pkg_add -uu
pkg_add: missing package name(s)

pkg_add -uu *
pkg_add: no pkg found for `*`, sorry

pkg_add -uu all
pkg_add: no pkg found for `all`, sorry

I've tried to parse the pkg_add man page but I can't tell what the command it to update everything.

I can't use pkg_chk because its not installed, and I can't get the package system to install it:

pkg_chk -b
pkg_chk: command not found

pkg_add pkg_chk
pkg_add: no pkg found for `pkg_chk`, sorry

What is the secret command to get the OS to update everything?

  • Do you have pkg_path setup properly? also what is out put for pkg_info -a – Jay Patel Nov 21 '16 at 9:51
  • pkg_add(1) needs a package name in all invocations. I assume you have a PKG_PATH set, what is it's value? – Eric Schnoebelen Nov 21 '16 at 15:21
  • @Eric - the value of PKG_PATH is ftp://ftp.netbsd.org/pub/pkgsrc/packages/NetBSD/amd64/7.0/All. – user56041 Jan 7 '17 at 0:53

First off see the quickstart for using pkgsrc at http://www.pkgsrc.org/#index1h1

For more details see Using Pkgsrc: Using binary packages

However I would recommend using pkgin, especially if you will only be using binary packages (i.e. not building packages from pkgsrc itself). Once you have $PKG_PATH set correctly in your shell environment (see the instructions in the quickstart section) you should be able to run pkg_add pkgin and continue with pkgin Usage (though note the value of your specific $PKG_PATH is what you want to put in the repositories.conf file -- the one in the usage section is just an example).

BTW, the wiki article you link to is out of date in a number of respects. The meaning of -u has changed slightly since NetBSD-6 -- in 7.0 and newer it no longer has any special meaning if it is given more than once.

| improve this answer | |
  • Thanks Greg. Two month later I'm back on a BSD cycle. When I search for terms like "how to update NetBSD", I land on my own question. To answer your questions, the program pkgin is missing, and results in a "command not found". PKG_PATH is set ftp://ftp.netbsd.org/pub/pkgsrc/packages/NetBSD/amd64/7.0/All. How can I specify a "please just work switch" to pkg_add? I don't care what it uses for defaults as long as it works. How can NetBSD be legendary for security if it can't even patch itself out of the box? It reminds me of Microsoft software in the 1990s. Its worse than Windows 95. – user56041 Jan 7 '17 at 0:49
  • You didn't run pkg_add pkgin yet, did you? – Greg A. Woods Jan 13 '17 at 0:41
  • BTW, NetBSD security is about good design, not about patching. – Greg A. Woods Jan 13 '17 at 0:42
  • Thanks for the suggestion. pkg_add: no pkg found for pkgin, sorry. – user56041 Jan 13 '17 at 0:55
  • So, you must have unset PKG_PATH or otherwise changed it before trying that? I just tried it with the PKG_PATH you showed and it worked fine for me. – Greg A. Woods Jan 13 '17 at 1:04

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy