I performed an rm -r on /var/lib/pkg

Mel fbsd.questions at rachie.is-a-geek.net
Fri Oct 12 14:14:02 PDT 2007


On Friday 12 October 2007 22:19:41 RW wrote:
> On Thu, 11 Oct 2007 14:26:19 -0600
>
> James <jamesh at lanl.gov> 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


More information about the freebsd-questions mailing list