Help please... Upgrade to pkg no workie
Matthew Seaman
matthew at FreeBSD.org
Wed Apr 26 07:32:30 UTC 2017
On 25/04/2017 22:34, Ronald F. Guilmette wrote:
>
> 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.)
Given how many packages you tend to have that depend on perl, in this
situation my advice would be to punt on this system entirely, and build
a new 11.0 setup to fulfil the same functions. Even if you have to buy
a new hard drive to install the 11.0 system on within the same chassis.
> 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:
It's not just pkg that you're going to have problems with when running
such an old system. The ports tree hasn't supported FreeBSD 9.x since
9.3-RELEASE went out of support at the end of December, and lots of
compatibility hacks have since been dyked out.
> 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.
This converts the existing pkg_tools /var/db/pkg into the package
database used by pkg(8)
> 2) Put a line like "WITH_PKGNG=yes" into /etc/make.conf
This tells the ports to use pkg(8) rather than pkg_tools. I'm not sure
if this variable still does anything with a current ports tree -- pkg(8)
is assumed nowadays.
Even so, both of these steps should be taken before trying to use the
ports with pkg(8), but it doesn't really matter what order you do them in.
> 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.)
/usr/sbin/pkg is pkg(7). It's a small shim that serves to download and
install the up-to-date pkg(8). Which isn't going to work, as there
isn't a FreeBSD-9.x version of pkg(8) or even a FreeBSD-9.x package repo
available today.
> 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?
What you would need to do is build pkg from source via the
ports-mgmt/pkg port
> Any & all advice appreciated.
>
> (I still desperately need to get Perl upgraded.)
Like I said, in the end you'll find it a lot easier and more productive
to start from a fresh install on a blank system and recreate the
functionality of your server from scratch.
Cheers,
Matthew
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 931 bytes
Desc: OpenPGP digital signature
URL: <http://lists.freebsd.org/pipermail/freebsd-pkg/attachments/20170426/49acb101/attachment.sig>
More information about the freebsd-pkg
mailing list