From owner-freebsd-questions@FreeBSD.ORG Fri Oct 12 21:14:02 2007 Return-Path: Delivered-To: freebsd-questions@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 7D20116A46C for ; Fri, 12 Oct 2007 21:14:02 +0000 (UTC) (envelope-from fbsd.questions@rachie.is-a-geek.net) Received: from snoogles.rachie.is-a-geek.net (rachie.is-a-geek.net [66.230.99.27]) by mx1.freebsd.org (Postfix) with ESMTP id 5703C13C491 for ; Fri, 12 Oct 2007 21:14:02 +0000 (UTC) (envelope-from fbsd.questions@rachie.is-a-geek.net) Received: from localhost (localhost [127.0.0.1]) by snoogles.rachie.is-a-geek.net (Postfix) with ESMTP id 74C0C1CDFC for ; Fri, 12 Oct 2007 13:14:01 -0800 (AKDT) From: Mel To: freebsd-questions@freebsd.org Date: Fri, 12 Oct 2007 23:13:58 +0200 User-Agent: KMail/1.9.7 References: <1192134379.33933.9.camel@secretariat.lanl.gov> <20071012211941.29038bc2@gumby.homeunix.com.> In-Reply-To: <20071012211941.29038bc2@gumby.homeunix.com.> MIME-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: 7bit Content-Disposition: inline Message-Id: <200710122313.59809.fbsd.questions@rachie.is-a-geek.net> Subject: Re: I performed an rm -r on /var/lib/pkg X-BeenThere: freebsd-questions@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: User questions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 12 Oct 2007 21:14:02 -0000 On Friday 12 October 2007 22:19:41 RW wrote: > On Thu, 11 Oct 2007 14:26:19 -0600 > > James wrote: > > Call it a moment of sheer stupidity, call it a misremembering, call it > > whatever you want (and I imagine I'll hear a few different ones), but > > I just did an rm -r /var/lib/pkg. > > > > Before I type anything to damage things further, does anyone have any > > suggestions as to how to recover from this? I have other FreeBSD boxes > > available to me, none with the same pkg list, though. I'll be reading > > man pkgdb in the meantime.. > > This came up recently in another thread, and what seemed to be the best > solution to me, was this: > > 1. work out which leaf-ports you actually need - don't worry about the > dependencies. > > 2. at your leisure build new packages under a chroot environment, or on > another machine. > > 3. back-up /usr/local/etc (or the whole of /usr/local) > > 4. rm -rf /usr/local/* > > 5. Restore /usr/local/etc and install packages. Why would you go through 3-5 when you can just mv /chroot/build/directory/var/db/pkg /var/db/pkg ? -- Mel