Skip site navigation (1)Skip section navigation (2)
Date:      Wed, 31 Aug 2022 09:33:08 +0200
From:      Baptiste Daroussin <bapt@FreeBSD.org>
To:        Kevin Oberman <rkoberman@gmail.com>
Cc:        FreeBSD Ports ML <freebsd-ports@freebsd.org>
Subject:   Re: Recover from a corrupt pkg DB
Message-ID:  <20220831073308.axcqj6nvunq64bg2@aniel.nours.eu>
In-Reply-To: <CAN6yY1vGf=LdXQ4DZjJRxho2t%2BNcGd0jt2-T7nhm84YjtCKN5g@mail.gmail.com>
References:  <CAN6yY1vGf=LdXQ4DZjJRxho2t%2BNcGd0jt2-T7nhm84YjtCKN5g@mail.gmail.com>

next in thread | previous in thread | raw e-mail | index | archive | help
On Tue, Aug 30, 2022 at 09:36:52AM -0700, Kevin Oberman wrote:
> I had a crash while building ffmpeg on a new system. The build had not
> begun, so I don't think ffmpeg is really an issue. portmaster(8) was
> walking the dependency tree when the system panicked and, after a reboot
> and full fsck, I get the error:
> pkg: sqlite error while executing PRAGMA user_version; in file
> pkgdb.c:2357: database disk image is malformed
> 
> Is there any way to rebuild the DB or, if not, how do I remove it and start
> from scratch?

rm /var/db/pkg/local.sqlite
xzcat /var/backups/pkg.sql.xz | pkg shell

Best regards,
Bapt



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