From owner-freebsd-questions@FreeBSD.ORG Fri Dec 1 00:38:05 2006 Return-Path: X-Original-To: freebsd-questions@freebsd.org Delivered-To: freebsd-questions@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 7B94616A412 for ; Fri, 1 Dec 2006 00:38:05 +0000 (UTC) (envelope-from illoai@gmail.com) Received: from nf-out-0910.google.com (nf-out-0910.google.com [64.233.182.186]) by mx1.FreeBSD.org (Postfix) with ESMTP id 0D33243C9D for ; Fri, 1 Dec 2006 00:37:53 +0000 (GMT) (envelope-from illoai@gmail.com) Received: by nf-out-0910.google.com with SMTP id x37so3218383nfc for ; Thu, 30 Nov 2006 16:38:03 -0800 (PST) DomainKey-Signature: a=rsa-sha1; q=dns; c=nofws; s=beta; d=gmail.com; h=received:message-id:date:from:to:subject:cc:in-reply-to:mime-version:content-type:content-transfer-encoding:content-disposition:references; b=MsTvVD8vza6KsME/0IMMZfqAVjXREqLbMmS8tggVXxprnBpkBdqmSpi98NV2qx28rSPVLiNMbVbw6kEt0hJp5WKs2C/gtdyBuSMFfG993FyjZwJzc6ZG+Z8otGhlUO/ZEyk0+ZnzOGESt851IQ2cR7BtJ5H28oVFNHvHeG7u28c= Received: by 10.82.153.5 with SMTP id a5mr947869bue.1164933483545; Thu, 30 Nov 2006 16:38:03 -0800 (PST) Received: by 10.82.175.1 with HTTP; Thu, 30 Nov 2006 16:38:03 -0800 (PST) Message-ID: Date: Thu, 30 Nov 2006 18:38:03 -0600 From: "illoai@gmail.com" To: shih@math.jussieu.fr In-Reply-To: <20061130213046.GA6346@math.jussieu.fr> MIME-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: quoted-printable Content-Disposition: inline References: <20061129222956.GA28232@math.jussieu.fr> <718eeb340611300504v6bfc3cedi970fb989ef66af08@mail.gmail.com> <20061130213046.GA6346@math.jussieu.fr> Cc: Chris , freebsd-questions@freebsd.org Subject: Re: corrupt my ports 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, 01 Dec 2006 00:38:05 -0000 An 11/30/06, cwaeth Albert Shih : > Le 30/11/2006 13:04:33+0000, Chris a =E9crit > > Try "man pkgdb". Specifically "pkgdb -F". > > > > Hummm... > > The pkgdb command is a tool to create or update the system package d= ata- > base which is used by the portupgrade(1) tool suite. It maintains a= hash > that maps an installed file to a package name, a hash that maps a pa= ckage > to an origin, and a list of installed packages. > > It's not my database is corrupt, but really my > > /var/db/pkg/* > > for example > > [root@freebsd2 /var/db/pkg]# ls -l firefox-2.0_2,1/ > total 28 > -rw-r--r-- 1 root wheel 52 12 nov 02:27 +COMMENT > -rw-r--r-- 1 root wheel 765 12 nov 02:27 +DEINSTALL > -rw-r--r-- 1 root wheel 345 12 nov 02:27 +DESC > -rw-r--r-- 1 root wheel 1119 12 nov 02:27 +DISPLAY > -rw-r--r-- 1 root wheel 1165 12 nov 02:27 +INSTALL > -r--r--r-- 1 root wheel 15305 12 nov 02:27 +MTREE_DIRS > -rw-r--r-- 1 root wheel 32 28 nov 23:37 +REQUIRED_BY > [root@freebsd2 /var/db/pkg]# > > I don't have +CONTENT file.... > > Anyone can help me ? The only cure I can think of is to reinstall the affected packages/ports, since these (or those) are the files that tell all (any) of the intended management tools what actually is installed and where. As an aside, backing up your /var/db/pkg will save you a bit of trouble should something go wrong with the disk, however in the event of a mangled upgrade it likely will not, since the backup will not match what is on disk any- more (or more to the point the backup will not match what is needed for what was mangled by the mangler). Probably still ought to take the backups with every updating. A simple tar -jcf /backup/file/name.tar.bz2 /var/db/pkg/ for 301 packages took about 90 seconds and consumes 2.9M of disk space. Not a lot of overhead there. Excluding /var/db/pkg/pkgdb.db (which would be rebuilt anyway) would probably cut those figures in half. --=20 --