Date: Wed, 31 Aug 2022 09:44:22 -0700 From: Kevin Oberman <rkoberman@gmail.com> To: Baptiste Daroussin <bapt@freebsd.org> Cc: FreeBSD Ports ML <freebsd-ports@freebsd.org> Subject: Re: Recover from a corrupt pkg DB Message-ID: <CAN6yY1uTMUStPfsraLXUBeq81jBvJp=F41bFgcQ2fJ7kXU8pRA@mail.gmail.com> In-Reply-To: <20220831073308.axcqj6nvunq64bg2@aniel.nours.eu> References: <CAN6yY1vGf=LdXQ4DZjJRxho2t%2BNcGd0jt2-T7nhm84YjtCKN5g@mail.gmail.com> <20220831073308.axcqj6nvunq64bg2@aniel.nours.eu>
next in thread | previous in thread | raw e-mail | index | archive | help
--000000000000746d5005e78c38a5 Content-Type: text/plain; charset="UTF-8" On Wed, Aug 31, 2022 at 12:33 AM Baptiste Daroussin <bapt@freebsd.org> wrote: > 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 > Thanks, Bapt! That is exactly what I was looking for, though with only 210 ports installed, on a system which had a rather broken installation, I decided to newfs the system and start over. This was clearly the right choice as several things are now working much better. It would be great to have this documented somewhere as corrupt databases are a rare, but real issue. -- Kevin Oberman, Part time kid herder and retired Network Engineer E-mail: rkoberman@gmail.com PGP Fingerprint: D03FB98AFA78E3B78C1694B318AB39EF1B055683 --000000000000746d5005e78c38a5 Content-Type: text/html; charset="UTF-8" Content-Transfer-Encoding: quoted-printable <div dir=3D"ltr"><div dir=3D"ltr"><div class=3D"gmail_default" style=3D"fon= t-family:tahoma,sans-serif;font-size:small">On Wed, Aug 31, 2022 at 12:33 A= M Baptiste Daroussin <<a href=3D"mailto:bapt@freebsd.org">bapt@freebsd.o= rg</a>> wrote:<br></div></div><div class=3D"gmail_quote"><blockquote cla= ss=3D"gmail_quote" style=3D"margin:0px 0px 0px 0.8ex;border-left:1px solid = rgb(204,204,204);padding-left:1ex">On Tue, Aug 30, 2022 at 09:36:52AM -0700= , Kevin Oberman wrote:<br> > I had a crash while building ffmpeg on a new system. The build had not= <br> > begun, so I don't think ffmpeg is really an issue. portmaster(8) w= as<br> > walking the dependency tree when the system panicked and, after a rebo= ot<br> > and full fsck, I get the error:<br> > pkg: sqlite error while executing PRAGMA user_version; in file<br> > pkgdb.c:2357: database disk image is malformed<br> > <br> > Is there any way to rebuild the DB or, if not, how do I remove it and = start<br> > from scratch?<br> <br> rm /var/db/pkg/local.sqlite<br> xzcat /var/backups/pkg.sql.xz | pkg shell<br> <br> Best regards,<br> Bapt<br> </blockquote></div><br clear=3D"all"><div style=3D"font-family:tahoma,sans-= serif;font-size:small" class=3D"gmail_default">Thanks, Bapt! That is exactl= y what I was looking for, though with only 210 ports installed, on a system= which had a rather broken installation, I decided to newfs the system and = start over. This was clearly the right choice as several things are now wor= king much better.</div><div style=3D"font-family:tahoma,sans-serif;font-siz= e:small" class=3D"gmail_default"><br></div><div style=3D"font-family:tahoma= ,sans-serif;font-size:small" class=3D"gmail_default">It would be great to h= ave this documented somewhere as corrupt databases are a rare, but real iss= ue.<br></div><br>-- <br><div dir=3D"ltr" class=3D"gmail_signature"><div dir= =3D"ltr"><div><div dir=3D"ltr"><div><div dir=3D"ltr"><div><div dir=3D"ltr">= Kevin Oberman, Part time kid herder and retired Network Engineer<br>E-mail:= <a href=3D"mailto:rkoberman@gmail.com" target=3D"_blank">rkoberman@gmail.c= om</a><br></div><div>PGP Fingerprint: D03FB98AFA78E3B78C1694B318AB39EF1B055= 683</div></div></div></div></div></div></div></div></div> --000000000000746d5005e78c38a5--
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?CAN6yY1uTMUStPfsraLXUBeq81jBvJp=F41bFgcQ2fJ7kXU8pRA>