Skip site navigation (1)Skip section navigation (2)
Date:      Sun, 10 Jan 2016 09:32:40 +0000
From:      Matthew Seaman <matthew@FreeBSD.org>
To:        freebsd-questions@freebsd.org
Subject:   Re: "pkg: pkg is not installed" even after installing it
Message-ID:  <56922538.7080105@FreeBSD.org>
In-Reply-To: <5691d97a.VHZI0elGOQrdG7%2Be%perryh@pluto.rain.com>
References:  <5691d97a.VHZI0elGOQrdG7%2Be%perryh@pluto.rain.com>

next in thread | previous in thread | raw e-mail | index | archive | help
This is an OpenPGP/MIME signed message (RFC 4880 and 3156)
--pL6MjQo4tRI8IjgqVAcsafCNIUil7BBpu
Content-Type: text/plain; charset=windows-1252
Content-Transfer-Encoding: quoted-printable

On 10/01/2016 04:09, Perry Hutchison wrote:
> Why does it claim that pkg is not installed, when it just got through
> installing it?  Or, if the install failed part way through, why was the=
re
> no error message?  And yes, the "pkg add" really did install something =
--
> /mnt/usr/local/sbin did not exist before running "pkg add" -- and what =
it
> installed is at least partly functional:
>   # ls -lR /mnt/usr/local
>   total 1
>   drwxrwxrwx  2 root    wheel  512 Jan  9 18:11 pkg
>   drwxr-xr-x  2 perryh  wheel  512 Jan  9 18:19 sbin
>   /mnt/usr/local/pkg:
>   total 2445
>   -r--r--r--  1 perryh  perryh  2487404 Jul 29 18:13 pkg.txz
>   -r--r--r--  1 perryh  perryh      727 Jul 30 17:59 pkg.txz.sig
>   /mnt/usr/local/sbin:
>   total 4472
>   -rwxr-xr-x  1 root  wheel  4559004 Jul 29 18:13 pkg-static

pkg(7) -- the shim that comes with the system -- is what produces the
'pkg is not installed' message.  That's the result of checking that
${LOCALBASE}/sbin/pkg exists and is executable.  ${LOCALBASE} defaults
to /usr/local.

It seems you have only /usr/local/sbin/pkg-static so your installation
of pkg(8) -- the actual pkg software -- looks to have fallen over
somewhere in the middle.  pkg-static is pulled out of the pkg.txz
tarball and installed first, then that copy of pkg-static is used to do
a full install of the entire set of stuff comprising pkg(8) from the
pkg.txz tarball.  That includes the dynamically linked pkg binary and
numerous man pages plus various other bits and pieces.

What it seems you are missing is are writable /var/db/pkg/ and
/var/cache/pkg directories -- this are where pkg(8) holds its database
of what packages have been installed, and where it holds copies of the
package tarballs, respectively.

It's definitely a bug that your procedure fails without any sort of
error message.  There should be load complaints from pkg(8) that it
cannot initialize the database, but somehow those are not making it
through to your console.  You should see some messages if you try running=
:

  /usr/local/sbin/pkg-static add /usr/local/pkg/pkg.txz

and that should show exactly what pkg(8) is having trouble with.

	Cheers,

	Matthew




--pL6MjQo4tRI8IjgqVAcsafCNIUil7BBpu
Content-Type: application/pgp-signature; name="signature.asc"
Content-Description: OpenPGP digital signature
Content-Disposition: attachment; filename="signature.asc"

-----BEGIN PGP SIGNATURE-----
Version: GnuPG/MacGPG2 v2

iQJ8BAEBCgBmBQJWkiU/XxSAAAAAAC4AKGlzc3Vlci1mcHJAbm90YXRpb25zLm9w
ZW5wZ3AuZmlmdGhob3JzZW1hbi5uZXQ2NTNBNjhCOTEzQTRFNkNGM0UxRTEzMjZC
QjIzQUY1MThFMUE0MDEzAAoJELsjr1GOGkAT+wcQAJJUcvGTmFdYTDQpRlTc5wX+
D0qAi9au12MtthghpJE2A42fw7DtDlfxhmRQVVDvC1Xj6mkt6pqJsBIU7B9UHrQP
0F2lxnYUj46oro+gviNU8N6uxJsmitTO5cyq+QVK23+1m9ylYw3vEZO0jwcC6Oof
PFCFdCavonmMmJ92kG/v14EZM3vdZUar4jRPdZ22VqvPyoEHOBQLqYKenP7YqFde
nnmPDTRIMbPLDU99/1+8AiuBSn/9O2heVAMtS+YnBitKphpohfhaBbCK/iVCj0p6
XKpm2ebCQkCL81oXEhCQtrXbgomeGS0g3M2ruF0ZB+BLZf/cMK8MVAsIM32ti8mb
vB1TPUPClDcUO8Mx5JhlZspVb3mIqsVfsULxRMzpj4/Fdw3VfaYUr4EgczMQ7712
dN7n6VOo5RwkgykTQdkVjCP7qPSbLXJqZZQ7Oke/s1wdmkFfOUyhRCe7abyvvU1D
rnxNX5ubo6yX9KDvvvNus5lk5BbXsTz6hVlnQRrL1aVKFntaJAWb5T/anPI0qpgj
GqppbiNGKYFzlUBTBbs684MNXCi678z9LHlTd4cewGdBFobSlC+/WI90BvFJgvuB
c0lYkzPrZpVGIECLBsjIDiJ4x6XWos1/nIouUvmoQ5ZzjVgTKpT15ytC1h6dYHvV
HPuVF3/CnDFbPbzGhYUK
=54w3
-----END PGP SIGNATURE-----

--pL6MjQo4tRI8IjgqVAcsafCNIUil7BBpu--



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?56922538.7080105>