From owner-freebsd-ports@FreeBSD.ORG Wed May 13 08:17:15 2015 Return-Path: Delivered-To: freebsd-ports@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 5FFA8ED8 for ; Wed, 13 May 2015 08:17:15 +0000 (UTC) Received: from homiemail-a58.g.dreamhost.com (sub5.mail.dreamhost.com [208.113.200.129]) by mx1.freebsd.org (Postfix) with ESMTP id 454F01FB8 for ; Wed, 13 May 2015 08:17:14 +0000 (UTC) Received: from homiemail-a58.g.dreamhost.com (localhost [127.0.0.1]) by homiemail-a58.g.dreamhost.com (Postfix) with ESMTP id 76C337D8060; Wed, 13 May 2015 01:17:14 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha1; c=relaxed; d=ozzmosis.com; h=date:from :to:subject:message-id:references:mime-version:content-type: in-reply-to; s=ozzmosis.com; bh=ikKMq1m78cKIebBAN4UEIZX0z6o=; b= xMifJK2/v7AfOuGExgpH3d/KVCfGjez36RDUo7Ru9KAwpQ9rmskeyqxpSCvdkhf7 GrkV9Qz/m9KdCMpuEob/MgLNENBMq1+s8hdiA+aLm0mPsspReiVlY2p+QcLL3t9T eMZBYrhmycUKUc5lSiPmwRXNM43BZEcKU7SbRzU0qqU= Received: from blizzard.ozzmosis.com (124-170-17-20.dyn.iinet.net.au [124.170.17.20]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) (Authenticated sender: relay@ozzmosis.com) by homiemail-a58.g.dreamhost.com (Postfix) with ESMTPSA id 178907D805B; Wed, 13 May 2015 01:17:14 -0700 (PDT) Received: by blizzard.ozzmosis.com (Postfix, from userid 1001) id 81C065CC8; Wed, 13 May 2015 18:17:12 +1000 (AEST) Date: Wed, 13 May 2015 18:17:12 +1000 From: andrew clarke To: Scott Bennett , freebsd-ports@freebsd.org Subject: Re: damage to pkg's sqlite data base Message-ID: <20150513081712.GC18834@ozzmosis.com> References: <201505120617.t4C6HkA3019096@sdf.org> <20150513075526.GA18834@ozzmosis.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20150513075526.GA18834@ozzmosis.com> User-Agent: Mutt/1.5.23 (2014-03-12) X-BeenThere: freebsd-ports@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: Porting software to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 13 May 2015 08:17:15 -0000 On Wed 2015-05-13 17:55:26 UTC+1000, andrew clarke (mail@ozzmosis.com) wrote: > $ sqlite3 local.sqlite.new > SQLite version 3.8.10.1 2015-05-09 12:14:55 > Enter ".help" for usage hints. > sqlite> .read local.sqlite.dump > sqlite> .quit > > Now we can use our newly created database, which should be error-free: > > $ sudo cp /var/db/pkg/local.sqlite /var/db/pkg/local.sqlite.backup > $ sudo mv local.sqlite.new /var/db/pkg/local.sqlite > > I don't guarantee any of the above will work. It will depend on how > much the database is corrupted etc. > > You will also need databases/sqlite3 installed, which unfortunately > isn't provided in the FreeBSD base system. This could be a problem if > pkg refuses to install anything. In that case I would either run the Actually I was wrong about this. The pkg command has the sqlite3 interpreter built-in, accessed via "pkg shell", that opens local.sqlite by default: $ pkg shell SQLite version 3.8.8.2 2015-01-30 14:30:45 Enter ".help" for usage hints. sqlite> .quit So there is no real need to install databases/sqlite3. Regards Andrew