0

I'm running NetBSD on the Raspberry Pi 1 Model B.

uname -a
NetBSD rpi 7.99.64 NetBSD 7.99.64 (RPI.201703032010Z) evbarm

I'm trying to install pkgin but I'm receiving an error about version mismatch ...

pkg_add -f pkgin
pkg_add: Warning: package `pkgin-0.9.4nb4' was built for a platform:
pkg_add: NetBSD/earmv6hf 7.99.42 (pkg) vs. NetBSD/earmv6hf 7.99.64 (this host)
pkg_add: Warning: package `pkg_install-20160410nb1' was built for a platform:
pkg_add: NetBSD/earmv6hf 7.99.58 (pkg) vs. NetBSD/earmv6hf 7.99.64 (this host)
pkg_add: Can't create pkgdb entry: /var/db/pkg/pkg_install-20160410nb1: Permission denied
pkg_add: Can't install dependency pkg_install>=20130901, continuing
pkg_add: Warning: package `libarchive-3.3.1' was built for a platform:
pkg_add: NetBSD/earmv6hf 7.99.59 (pkg) vs. NetBSD/earmv6hf 7.99.64 (this host)
pkg_add: Can't create pkgdb entry: /var/db/pkg/libarchive-3.3.1: Permission denied
pkg_add: Can't install dependency libarchive>=3.2.1nb2, continuing
pkg_add: Can't create pkgdb entry: /var/db/pkg/pkgin-0.9.4nb4: Permission denied
pkg_add: 1 package addition failed

How can I install the correct version?

Kusalananda
  • 320,670
  • 36
  • 633
  • 936
BugHunterUK
  • 380
  • 1
  • 2
  • 17

1 Answers1

1

pkg_add should be run with superuser privileges. You may switch to root using su -l to execute it, or, if you have sudo installed, you may use sudo pkg_add.

Kusalananda
  • 320,670
  • 36
  • 633
  • 936
  • Ok will try this, but I was running as `root` already. Why is `sudo` required if running as `root`? – BugHunterUK Apr 20 '17 at 00:55
  • @BugHunterUK I don't think you were running as root. Root wouldn't have had those permission denied errors. – Kusalananda Apr 20 '17 at 07:10
  • You're right. I was logged into 3 different rpi's all using the same netbsd image. The one I was having issues on wasn't logged in as root. – BugHunterUK Apr 21 '17 at 09:18
  • and besides, `sudo` is evil and never actually required -- just use `su`! – Greg A. Woods Aug 23 '19 at 06:54
  • @GregA.Woods There are many benefits of using `sudo` over `su`. Logging of each individual command is one. It is only "evil" in the sense that its configuration is unnecessarily complex for most setups. This is why OpenBSD introduced the simpler `doas` command. – Kusalananda Aug 23 '19 at 06:57
  • No, `sudo` is pure evil. It is an accident waiting to happen. It cannot be used securely. – Greg A. Woods Aug 23 '19 at 07:07
  • @GregA.Woods You can say the same thing about `rm`. It is an accident waiting to happen, and it can not be use securely. As long as you don't give any context or reasoning, your comments here are not helping with clarifying my answer, or the question. – Kusalananda Aug 23 '19 at 07:14
  • If you want to clarify your answer then you can simplify it -- take out the `sudo` step. It is unnecessary and simply makes the resulting system less secure. `su` is all that is required here, and it is a native part of the base OS. – Greg A. Woods Aug 23 '19 at 18:07
  • @GregA.Woods Better now? I _really_ don't see how using `sudo` to execute `pkg_add` would make the system less secure. Could you possibly enlighten me on that point? – Kusalananda Aug 23 '19 at 18:34
  • One step, instead of two. Just use `su`. Period. Nothing more is needed. – Greg A. Woods Aug 23 '19 at 23:54