From owner-freebsd-questions@FreeBSD.ORG Wed Jun 13 12:04:00 2012 Return-Path: Delivered-To: freebsd-questions@freebsd.org Received: from mx1.freebsd.org (unknown [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 344C51065670; Wed, 13 Jun 2012 12:04:00 +0000 (UTC) (envelope-from roberthuff@rcn.com) Received: from smtp02.lnh.mail.rcn.net (smtp02.lnh.mail.rcn.net [207.172.157.102]) by mx1.freebsd.org (Postfix) with ESMTP id BE7EB8FC1E; Wed, 13 Jun 2012 12:03:59 +0000 (UTC) Received: from mr17.lnh.mail.rcn.net ([207.172.157.37]) by smtp02.lnh.mail.rcn.net with ESMTP; 13 Jun 2012 08:03:53 -0400 Received: from smtp01.lnh.mail.rcn.net (smtp01.lnh.mail.rcn.net [207.172.4.11]) by mr17.lnh.mail.rcn.net (MOS 4.3.4-GA) with ESMTP id BNP52719; Wed, 13 Jun 2012 08:03:52 -0400 Received-SPF: None identity=pra; client-ip=209.6.86.84; receiver=smtp01.lnh.mail.rcn.net; envelope-from="roberthuff@rcn.com"; x-sender="roberthuff@rcn.com"; x-conformance=sidf_compatible Received-SPF: Neutral identity=mailfrom; client-ip=209.6.86.84; receiver=smtp01.lnh.mail.rcn.net; envelope-from="roberthuff@rcn.com"; x-sender="roberthuff@rcn.com"; x-conformance=sidf_compatible; x-record-type="v=spf1" Received-SPF: None identity=helo; client-ip=209.6.86.84; receiver=smtp01.lnh.mail.rcn.net; envelope-from="roberthuff@rcn.com"; x-sender="postmaster@jerusalem.litteratus.org.litteratus.org"; x-conformance=sidf_compatible Received: from 209-6-86-84.c3-0.smr-ubr2.sbo-smr.ma.cable.rcn.com (HELO jerusalem.litteratus.org.litteratus.org) ([209.6.86.84]) by smtp01.lnh.mail.rcn.net with ESMTP; 13 Jun 2012 08:03:51 -0400 From: Robert Huff MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit Message-ID: <20440.33190.905351.819751@jerusalem.litteratus.org> Date: Wed, 13 Jun 2012 08:03:50 -0400 To: Matthew Seaman In-Reply-To: <4FD8304C.7000004@FreeBSD.org> References: <4FD8304C.7000004@FreeBSD.org> X-Mailer: VM 7.17 under 21.5 (beta28) "fuki" XEmacs Lucid X-Junkmail-Whitelist: YES (by domain whitelist at mr17.lnh.mail.rcn.net) Cc: freebsd-questions@freebsd.org Subject: Re: Lost /var/db/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: Wed, 13 Jun 2012 12:04:00 -0000 Matthew Seaman writes: > > I had a hard disk failure some time ago, and I ended up losing > > /var/db/pkg/ and everything under it (before you say I should've been > > backing it up, I know, I was actually doing an initial full when this > > happened). Is there a way I can restore it, or at least manually add > > entries I know for sure about? > > Reinstall all the ports on your system? Since you've lost > /var/db/pkg, you won't have a handy record of what the necessary > packages are. You can get a long way by starting with ports you > want directly (eg. firefox) and reinstalling all of their > dependencies. > > It's unlikely to be completely accurate, and the system will > probably have odd little issues with normal ports maintenance > going on. Perhaps the most effective procedure would be to wipe > out the contents of /usr/local and /compat/linux and just start > again from scratch. Only that's going to eradicate anything in /usr/local that a) one wants/uses and b) wasn't put there by ports. (Tell me you don't have a handful of scripts which have been working happily away since you wrote them in the early Devonian. :-) A less drastic path would be to wipe out /usr/local/{lib, libexec}, /compat/linux, and whatever directory has port-installed docs. Check /usr/local/bin, /usr/local/etc (especially rc.d/), and /usr/local/share; many files there are named for their ports. Grep bin/ for anything whose first line is "#! /bin/sh", and figure out where it came from. _Now_ start with major prograns you know were installed - on my system that would be emacs, FireFox, Java, LibreOffice, ImageMagick, and mplayer - and get out your copy of - because even on a fast system you're talking days to put everything back. Robert "learned the hard way" Huff