From owner-freebsd-questions@freebsd.org Mon Jan 11 03:15:48 2016 Return-Path: Delivered-To: freebsd-questions@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id CAB03A6A800 for ; Mon, 11 Jan 2016 03:15:48 +0000 (UTC) (envelope-from perryh@pluto.rain.com) Received: from agora.rdrop.com (agora.rdrop.com [IPv6:2607:f678:1010::34]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 9AE98113B; Mon, 11 Jan 2016 03:15:48 +0000 (UTC) (envelope-from perryh@pluto.rain.com) Received: from agora.rdrop.com (66@localhost [127.0.0.1]) by agora.rdrop.com (8.13.1/8.12.7) with ESMTP id u0B36dBV073500 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NOT); Sun, 10 Jan 2016 19:06:43 -0800 (PST) (envelope-from perryh@pluto.rain.com) Received: (from uucp@localhost) by agora.rdrop.com (8.13.1/8.14.2/Submit) with UUCP id u0B36cO7073498; Sun, 10 Jan 2016 19:06:38 -0800 (PST) (envelope-from perryh@pluto.rain.com) Received: from fbsd81 by pluto.rain.com (4.1/SMI-4.1-pluto-M2060407) id AA01122; Sun, 10 Jan 16 19:10:48 PST Date: Sun, 10 Jan 2016 19:10:45 -0800 From: perryh@pluto.rain.com (Perry Hutchison) To: matthew@freebsd.org Cc: freebsd-questions@freebsd.org Subject: Re: "pkg: pkg is not installed" even after installing it Message-Id: <56931d35.1U3OAjwPQuA2rasY%perryh@pluto.rain.com> References: <5691d97a.VHZI0elGOQrdG7+e%perryh@pluto.rain.com> <56922538.7080105@FreeBSD.org> In-Reply-To: <56922538.7080105@FreeBSD.org> User-Agent: nail 11.25 7/29/05 Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit X-BeenThere: freebsd-questions@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: User questions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 11 Jan 2016 03:15:48 -0000 Matthew Seaman wrote: > 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 > > there no error message? ... > > 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. That doesn't produce any output, either. However, after mounting tmpfs on /var/db/pkg and /var/cache, I got: # chroot -u 0 -g 0 -G 105,0,5,20,25 /mnt pkg-static add /usr/local/pkg/pkg.txz Installing pkg-1.5.4... Extracting pkg-1.5.4: 100% ldconfig: mkstemp(/var/run/ld-elf.so.hints.6wHhnd): Read-only file system pkg-static: POST-INSTALL script failed Message for pkg-1.5.4: If you are upgrading from the old package format, first run: # pkg2ng # chroot -u 0 -g 0 -G 105,0,5,20,25 /mnt pkg -N pkg: 1 packages installed This time it installed a bunch of stuff in /usr/local and a "local.sqlite" in /var/db/pkg -- but nothing in /var/cache, so maybe that isn't needed when installing from a tarball that is already local.