Re: Corrupted pkg db. Recoverable?
- In reply to: Jonathan Adams : "Corrupted pkg db. Recoverable?"
- Go to: [ bottom of page ] [ top of archives ] [ this month ]
Date: Mon, 17 Mar 2025 19:16:42 UTC
On Sat, Mar 15, 2025 at 01:45:50AM +0000, Jonathan Adams wrote: > Hi all, > I'm running 14.2-RELEASE-p2 with packages pulled from latest in Qemu running within Termux on an Android device. (I guess I like to create interesting challenges!) > > I recently ran `pkg upgrade`, then selected 'n' to cancel. (Too many packages.) Moments later, I decided to upgrade Vim only, and got this: > > # pkg install vim > Updating FreeBSD repository catalogue... > pkg: An error occured while fetching package: No error > pkg: An error occured while fetching package: No error > repository FreeBSD has no meta file, using default settings > pkg: An error occured while fetching package: No error > pkg: An error occured while fetching package: No error > pkg: An error occured while fetching package: No error > pkg: An error occured while fetching package: No error > Unable to update repository FreeBSD > Error updating repositories! > > I'm now unable to install|upgrade packages, though I can do `pkg delete <pkg>` and `pkg autoremove` just fine. > Is there a way to rebuild the pkg db, or in any way recover the ability to install|upgrade packages? I have backups of the drive images from before I updated to p2, but I'd like to try to fix the current install first. > you can recover from old sqlite db backups, but one thing that may be safer is to use "pkg-static" to check your db and rebuild your cache: pkg-static check pkg-static -f update -pete