Skip site navigation (1)Skip section navigation (2)
Date:      Tue, 18 Sep 2007 15:49:25 +0200
From:      Mel <fbsd.questions@rachie.is-a-geek.net>
To:        freebsd-questions@freebsd.org
Subject:   Re: Deleted /var/db/pkg
Message-ID:  <200709181549.27302.fbsd.questions@rachie.is-a-geek.net>
In-Reply-To: <8980.80.80.2.75.1190116887.squirrel@webmail1.one.com>
References:  <8980.80.80.2.75.1190116887.squirrel@webmail1.one.com>

next in thread | previous in thread | raw e-mail | index | archive | help
On Tuesday 18 September 2007 14:01:27 nikolaj.thygesen@diamondbox.dk wrote:

>     Suppose you deleted /var/db/pkg by accident :( What would you do to
> get it back??

Depending how fast your disk and cpu is:

cd /usr/ports
find . -name pkg-plist -print|xargs egrep -H '^(s?bin|lib)' |while read MATCH;
do
        PATH=${MATCH##*:}
        if test -f /usr/local/${PATH}; then
                 echo ${MATCH%%/pkg-plist:*}
        fi
done | grep -v XFree86-4-*|sort -u >myports.lst

Then look carefully for mismatches and feed myports.lst to portinstall.
-- 
Mel



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?200709181549.27302.fbsd.questions>