Help please... Upgrade to pkg no workie

Ronald F. Guilmette rfg at tristatelogic.com
Tue Apr 25 21:44:29 UTC 2017


This is rather embarassing, but OK, I confess... One of my
systems here is running the ancient FreeBSD 9.1 and it hasn't
been upgraded in a long long time.  Like not at all.  No package
updates, nothing.  Today however I desperately need to upgrade
the installed Perl.  (Apparently, the Perl that I have installed
on this system, v5.16, has an old and not at all up-to-date Unicode
implementation.)

As you all know, fBSD 9.1 used the older package system.  I am well and
truly aware of the fact that, in order to move forward, I will need
to upgrade to the new package system (pkg).  So I've been reading this
page that purports to give directions on exactly how to do that:

     https://www.freebsd.org/doc/handbook/pkgng-intro.html

Unfortunately, for me at least, the guidance here raises nearly
as many questions as it answers.  For example, it says to do these
two things:

     1)  Run pkg2ng.
     2)  Put a line like "WITH_PKGNG=yes" into /etc/make.conf

What it doesn't say is whether the first thing must be done strictly
*before* the second thing, or vise versa, or if the order here even
matters at all.  (I don't want to totally screw up my system, so in
the absence of complete clarity, and since I don't really know exactly
what the effects of either of these two steps really are, I am inclined
to proceed with great caution and thus requast clarification from this
list.)

Anyway, I decided to look and see if perchance I might already have
the new & improved pkg command on my system.  So I did "which pkg"
and lo and behold, an executable with that name is already present
on this system as /usr/sbin/pkg.  (I have no clear recollection, one
way or the other, whether or not, in years past, I may have deliberately
installed this /usr/sbin/pkg or not.)

Anyway, I decided to throw the dice and run this, with no options or
arguments, just to see if that would give me a list of command line
options or what.  I was almost immediately greeted with a message
saying that the new pkg system was *not* in fact actually installed
and asking me ([y/N]) if I wanted to install it.  I control-C'd out
of this, before I did any damage, and plotted my next move.

I realized that to actually install this thing, I'd probably need to be
root, so I su'd to root and then cd'd to ~root and started "script" so
that I'd have a full log in case anything went wrong... which it
promptly did.  Here's the log.  It isn't pretty.

==============================================================================
root at segfault:/root # pkg
The package management tool is not yet installed on your system.
Do you want to fetch and install it now? [y/N]: y
Bootstrapping pkg please wait
Installing pkg-1.9.4_1...
pkg-static: dup2(rootfd): Invalid argument
Extracting pkg-1.9.4_1:   0%
pkg-static: Fail to create /usr: Bad file descriptor
Extracting pkg-1.9.4_1: 100%

Failed to install the following 1 package(s): /tmp//pkg.txz.q9abRX
root at segfault:/root # exit
==============================================================================

So?  NOW what should I do?

Any & all advice appreciated.

(I still desperately need to get Perl upgraded.)


More information about the freebsd-pkg mailing list