Thx to all, I had always the possibility to restore from the backup stick so not a big deal..if not my initiative to investigate how to restore single corrupted packages files in /usr/local and leaving you some inputs by this list.
I'm intrigued more about /usr/local/sync.. what is it exactly ? dan From: Stuart Henderson <[email protected]> To: [email protected] Date: Oct 5, 2026 12:18:05 Subject: Re: Recover after a sudden system halt > On 2026-10-04, Matti Andreas Kähäri <[email protected]> wrote: >> On Sun, Oct 04, 2026 at 11:47:19AM +0930, Phil Maker wrote: >>> FWIW, >>> >>> The output of pkg_info can be feed into pkg_add so >>> you could perhaps keep the pkg_info output and use that >>> for a rebuild, then do an update. Anyways what I think you want >>> is there pkg_* but I could a tool in rust to do it. >> >> pkg_info -mz >list >> pkg_add -l list >> >> ... as documented in pkg_add(1) >> >> https://man.openbsd.org/pkg_add.1#l > > Also, if you suspect corruption in the package database itself, you > can find copies saved by security(8) from the most two recent updates > to the list of installed packages in /var/backups/pkglist.backup and > pkglist.current. It's not in the "pkg_info -z" format but iirc > pkg_add -z should still be able to cope. > > If there's major corruption in /usr/local I suggest you really want > to recreate the filesystem from scratch. Save the list of packages, > remove all packages as best you can with pkg_delete, check for anything > remaining important in /usr/local, unmount and newfs the device for > /usr/local, do an "update" install of OpenBSD to reinstate missing dirs, > then reinstall packages.

