1

I'm new to using NetBSD but I've set it up on a VM and am currently in the process of running through a few package installations. From what I understand this is done via setting the PKG_PATH variable and then using the pkg_add utility, however I'm getting a "Forbidden" error message when I try to install any package.

$ PKG_PATH="http://cdn.NetBSD.org/pub/pkgsrc/packages/$(uname -s)/$(uname -m)/$(uname -r|cut -f '1 2' -d.)/All/"
$ export PKG_PATH
$ pkg_add tmux
pkg_add: Can't process http://cdn.NetBSD.org:80/pub/pkgsrc/packages/NetBSD/amd64 /7.1/All//tmux*: Forbidden
pkg_add: no pkg found for 'tmux', sorry.
pkg_add: 1 package addition failed

I've visited the URL and the package does exist, also it does this for any package I try to install. From what I can tell the networking on the machine is fine so I'm a bit stuck as to where to go from here. Any suggestions?

  • In the error message you quote, there appears to be a space between the machine architecture and the OS version. Can you verify that your PKG_PATH variable lacks a space there? If there is a space, remove it and try again. – Eric Schnoebelen Apr 10 '17 at 15:50
  • No space in the path - it just formatted it weird. To verify, if I echo $PKG_PATH, I get:http://cdn.NetBSD.org/pub/pkgsrc/packages/NetBSD/amd64/7.1/All/ – fod93awwyeah Apr 11 '17 at 07:22
  • The error message isn't very helpful, but `Forbidden` in that context means that the web server returned a 403 error. I can't guess why though. As a work-around you can fetch the file using some other means then use `pkg_add` with the local pathname. Using `ftp` from that system to try to fetch the file with that same URL (but with the pathname `tmux-2.3nb2.tgz` appended of course) may provide additional diagnostics. – Greg A. Woods Apr 12 '17 at 02:49
  • Ah perfect, I'd been trying to workaround by downloading the files on my own machine and then moving them over but since they were tgz files I was unzipping them normally rather than using pkg_add for some reason. That seems to have done the trick, thanks! – fod93awwyeah Apr 12 '17 at 10:11

3 Answers3

1

I got a similar issue but instead of forbidden, I got "Unknown HTTP error" enter image description here My solution was changing from "https" to "http" and it worked for me. Hopefully that helps.

1

On NetBSD 9.3 (guest) inside the virtual Machine qemu on Gentoo with kernel version 9.1-19 (host), I got a similar issue but instead of "forbidden", I got "Timeout on HTTPS"- Again change https -> http worked for me, as well.

ricardo
  • 11
  • 3
0

1) try $PKG_PATH without the trailing slash, i.e. .../All instead of .../All/ 2) "tmux*" doesn't make sense for http, it only makes sense for ftp. something seems fishy.

I recommend raising this on tech-pkg@NetBSD.org

hubertf
  • 21
  • 1