From owner-freebsd-hackers@FreeBSD.ORG Thu Apr 22 11:18:06 2010 Return-Path: Delivered-To: freebsd-hackers@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 4A20C1065673; Thu, 22 Apr 2010 11:18:06 +0000 (UTC) (envelope-from mail25@bzerk.org) Received: from ei.bzerk.org (tunnel490.ipv6.xs4all.nl [IPv6:2001:888:10:1ea::2]) by mx1.freebsd.org (Postfix) with ESMTP id CC29A8FC18; Thu, 22 Apr 2010 11:18:05 +0000 (UTC) Received: from ei.bzerk.org (BOFH@localhost [127.0.0.1]) by ei.bzerk.org (8.14.3/8.14.3) with ESMTP id o3MBHwx7039469; Thu, 22 Apr 2010 13:17:59 +0200 (CEST) (envelope-from mail25@bzerk.org) Received: (from bulk@localhost) by ei.bzerk.org (8.14.3/8.14.3/Submit) id o3MBHwje039468; Thu, 22 Apr 2010 13:17:58 +0200 (CEST) (envelope-from mail25@bzerk.org) Date: Thu, 22 Apr 2010 13:17:58 +0200 From: Ruben de Groot To: Doug Barton Message-ID: <20100422111758.GA39338@ei.bzerk.org> Mail-Followup-To: Ruben de Groot , Doug Barton , "Aryeh M. Friedman" , freebsd-hackers@freebsd.org References: <4BCE5ECC.6070202@gmail.com> <4BCFE209.20501@FreeBSD.org> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <4BCFE209.20501@FreeBSD.org> User-Agent: Mutt/1.4.2.3i X-Spam-Status: No, score=-4.3 required=5.0 tests=ALL_TRUSTED,AWL,BAYES_00 autolearn=ham version=3.2.5 X-Spam-Checker-Version: SpamAssassin 3.2.5 (2008-06-10) on ei.bzerk.org X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.0.1 (ei.bzerk.org [127.0.0.1]); Thu, 22 Apr 2010 13:18:04 +0200 (CEST) X-Mailman-Approved-At: Thu, 22 Apr 2010 11:32:17 +0000 Cc: freebsd-hackers@freebsd.org, "Aryeh M. Friedman" Subject: Re: regenerating /var/db/pkg X-BeenThere: freebsd-hackers@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Technical Discussions relating to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 22 Apr 2010 11:18:06 -0000 On Wed, Apr 21, 2010 at 10:43:37PM -0700, Doug Barton typed: > On 4/20/2010 7:11 PM, Aryeh M. Friedman wrote: > > I acciddentally rm'ed my /var/db/pkg and want to know is it possible to > > rgenerate it (I have portmaster and portupgrade installed) > > Portmaster certainly can't do this, it uses the information from > /var/db/pkg. I'm not sure if portupgrade can do it or not. > > Your most likely course of success is to generate a list of ports that > you know you're using ("root" and "leaf" ports in portmaster > terminology), back up any config or other key files from /usr/local, > then delete everything and reinstall. This question (how to restore /var/db/pkg) comes up fairly regularly. How about adding a /etc/periodic/daily/220.backup-pkgdb script or something? Just asking opinions, if people want this, I'll make a patch and file a PR. Ruben