Initializing pkg

In 10.3 and now in 11RC2, when following the instruction in the Handbook to run

/usr/sbin/pkg

to bootstrap the pkg system, you get an error complaining that pkg was run with insufficient args.

Either the documentation is wrong or the bootstrap is process is causing this. Either way, it does not inspire confidence and whatever the cause, the problem should be fixed.
 
Last edited by a moderator:
FYI, we are both wrong. I've just setup a new FreeBSD VM and if you run /usr/sbin/pkg for the first time it asks if you want to fetch and install pkg.
 
FYI, we are both wrong. I've just setup a new FreeBSD VM and if you run /usr/sbin/pkg for the first time it asks if you want to fetch and install pkg.

That was not what happened with me. I just got the error message I reported about insufficient args. pkg did and does work correctly after this though. My issue is that doing what the doc says should not result in an error message of any kind. This also happened with two installs of 10.3.

kpa Your guess is not correct. This was a fresh install of 11RC2 and I had not installed ports-mgmt/pkg.
 
I'm not sure from mind but I could well imagine that there is a huge difference between the initial behavior of a stable release and that of a release candidate.
 
Code:
pkg-static install -f pkg

This is the answer to a question I didn't ask. My issue, if you read my original post again, is not getting pkg set up (which I did). It's that following the instructions in the documentation produces an error, which it should not.
 
I'm not sure from mind but I could well imagine that there is a huge difference between the initial behavior of a stable release and that of a release candidate.

Read my original post again. The behavior I report also occurred in the 10.3 *release*.
 
The error is correct, the handbook should use something like pkg -vv or, probably better, pkg bootstrap to prevent the error showing up.
 
The error is correct, the handbook should use something like pkg -vv or, probably better, pkg bootstrap to prevent the error showing up.

This should be fixed in the doc then. It does no operational harm (pkg does get bootrapped and works correctly afterwards despite the error), but it harms confidence in the system, just as getting compiler warnings do when building something that ends up working.
 
Incredibly, this *still* has not been fixed after almost a year.
Well, feel free to pick up the pace then ;)

Seriously though, although the command generates an error it's also fair to note that the bootstrap does work (see attachment from my VM). So basically the handbook isn't completely wrong here.
 

Attachments

  • pkg_bootstrap.png
    pkg_bootstrap.png
    11.3 KB · Views: 486
Well, feel free to pick up the pace then ;)

Seriously though, although the command generates an error it's also fair to note that the bootstrap does work (see attachment from my VM). So basically the handbook isn't completely wrong here.

If I had write access to the Handbook sources, I'd have fixed it last year :)

As for your second sentence, you are absolutely right, as far as you go. I am talking about the impression this makes. It is in the same category as spelling errors in one of the FreeBSD web pages. You could make the argument that if "seperate" appeared on a web page, everyone would understand that as "separate" (essentially the same argument you are making: "it works"). But it looks bad. FreeBSD is a serious system, the result of a lot of hard work by a lot of people over many years. I think it's a shame to let something like this, so easily fixed, detract from that, even in this very small way.
 
If I had write access to the Handbook sources, I'd have fixed it last year :)
You don't need that. Anybody can submit PRs for the documentation.

It is in the same category as spelling errors in one of the FreeBSD web pages. You could make the argument that if "seperate" appeared on a web page, everyone would understand that as "separate" (essentially the same argument you are making: "it works"). But it looks bad. FreeBSD is a serious system, the result of a lot of hard work by a lot of people over many years. I think it's a shame to let something like this, so easily fixed, detract from that, even in this very small way.
Submit PRs for it. Same as the documentation, anybody can submit fixes, updates or rewrites. Issues don't magically fix themselves, somebody has to submit a PR to set things in motion. If everybody thinks somebody else will fix it, nothing would get done. It's a community effort after all.

FreeBSD Documentation Project Primer for New Contributors
https://bugs.freebsd.org/bugzilla/enter_bug.cgi?product=Documentation
 
If I had write access to the Handbook sources, I'd have fixed it last year :)

https://www.freebsd.org/docproj/

I think it's a shame to let something like this, so easily fixed, detract from that, even in this very small way.

It's easy to surmise that the bootstrap process is just an extra step that's taken when pkg(7) is first run. The "not enough arguments" error appears because as soon as the bootstrapped binary is installed, pkg itself is actually executed. If you install a fresh system, reboot, then run pkg install xorg, you'll first be notified that pkg isn't installed yet and asked to bootstrap it. After that's done, pkg will move on to updating the package database and installing x11/xorg. pkg bootstrap is an extra, unnecessary step. The /usr/sbin/pkg mentioned in the Handbook is in fact a distinct binary that is replaced by the bootstrapped binary during the initial installation process. See pkg(7) (the bootstrapper) versus pkg(8) (the actual package manager).

Spelling all this out in the Handbook would certainly confuse new users more than a meaningless error message they only see one time, and you more-or-less figured it out yourself.
 
Back
Top