From owner-freebsd-ports@FreeBSD.ORG Wed May 13 09:07:35 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 7C87FB76 for ; Wed, 13 May 2015 09:07:35 +0000 (UTC) Received: from vps.rulingia.com (vps.rulingia.com [103.243.244.15]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "vps.rulingia.com", Issuer "CAcert Class 3 Root" (not verified)) by mx1.freebsd.org (Postfix) with ESMTPS id EA948162F for ; Wed, 13 May 2015 09:07:34 +0000 (UTC) Received: from server.rulingia.com (c220-239-242-83.belrs5.nsw.optusnet.com.au [220.239.242.83]) by vps.rulingia.com (8.14.9/8.14.9) with ESMTP id t4D90W7H040190 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Wed, 13 May 2015 19:00:38 +1000 (AEST) (envelope-from peter@rulingia.com) X-Bogosity: Ham, spamicity=0.000000 Received: from server.rulingia.com (localhost.rulingia.com [127.0.0.1]) by server.rulingia.com (8.14.9/8.14.9) with ESMTP id t4D90Rr6066428 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=NO); Wed, 13 May 2015 19:00:27 +1000 (AEST) (envelope-from peter@server.rulingia.com) Received: (from peter@localhost) by server.rulingia.com (8.14.9/8.14.9/Submit) id t4D90RFW066427; Wed, 13 May 2015 19:00:27 +1000 (AEST) (envelope-from peter) Date: Wed, 13 May 2015 19:00:27 +1000 From: Peter Jeremy To: andrew clarke Cc: Scott Bennett , freebsd-ports@freebsd.org Subject: Re: damage to pkg's sqlite data base Message-ID: <20150513090027.GB25775@server.rulingia.com> References: <201505120617.t4C6HkA3019096@sdf.org> <0dcbdcb9fdfdebc53a2563b11494f61b@ultimatedns.net> <201505130512.t4D5Cpqa011080@sdf.org> <20150513081244.GB18834@ozzmosis.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20150513081244.GB18834@ozzmosis.com> X-PGP-Key: http://www.rulingia.com/keys/peter.pgp 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 09:07:35 -0000 On 2015-May-13 18:12:44 +1000, andrew clarke wrote: >You can reinstall just those ports. Check /var/log/messages, eg. > >$ grep pkg /var/log/messages >May 12 14:34:38 blizzard pkg: poudriere upgraded: 3.1.4 -> 3.1.6 >May 12 14:38:08 blizzard pkg: git-lite-2.4.0 installed >May 13 08:29:04 blizzard pkg: sqlite3 upgraded: 3.8.9_1 -> 3.8.10.1 >May 13 08:29:05 blizzard pkg: spamassassin reinstalled: 3.4.1_1 -> 3.4.1_1 >May 13 08:29:05 blizzard pkg: ca_root_nss upgraded: 3.18.1 -> 3.19 That assumes you have syslog messages back to when you started using pkg. syslog was never intended to provide an audit trail. >You can't rebuild it. You couldn't rebuild it in the years before >pkgng existed, either. Depending on exactly what went wrong, plain text files are generally easier to manually fix up. >The "trick" is to revert to a known-good backup of the pkg database >that's generated daily by /usr/local/etc/periodic/daily/411.pkg-backup >in /var/backups/ : > >-rw-r--r-- 1 root wheel 2207320 2015-05-13 04:20:30 pkg.sql.xz >-rw-r--r-- 1 root wheel 2196088 2015-05-12 04:21:24 pkg.sql.xz.2 Assuming that they aren't corrupt. But that's better than nothing. Note that the backup is taken every day, whether or not there has been any change to the pkg database, so you have 2 days of backups, not the last two revisions. On 2015-May-13 18:17:12 +1000, andrew clarke wrote: >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: Some experimenting suggests that none of the pragma commands work in "pkg shell", so you probably will need to find a copy of sqlite3. -- Peter Jeremy