I have ufs file system.Please read from #6 onwards.pkg.sql.* is a compressed file created by pkg shell .dump.
See /usr/local/etc/periodic/daily/411.pkg-backup
You should be able to restore it with .read.
The /var/log/message file records the installation and uninstallation of packages.
Please check if any changes have been made since the backup.
My directory /vard/db/pkg is emptyDoes that get setup when you do pkg bootstrap?
If pkg is actually installed, what does pkg upgrade -n do? That should run it may recreate the file, I don't know for sure
pkg upgrade -n
Updating FreeBSD-ports repository catalogue...
FreeBSD-ports repository is up to date.
Updating FreeBSD-ports-kmods repository catalogue...
FreeBSD-ports-kmods repository is up to date.
All repositories are up to date.
Checking for upgrades (1 candidates): 100%
Processing candidates (1 candidates): 100%
Checking integrity... done (0 conflicting)
Your packages are up to date.
In /var/backups I have what is on the picture. The last backup is from april. One *.xz and the othe *.zst. Which one is correct, please?What does "ls /var/db/pkg" show? I have about 6 files in mine.
I don't know exactly what the contents of pkg.sql.xz is but the thread that Charlie_ points to should help you restore.
mv /var/db/pkg/local.sqlite /var/db/pkg/local.sqlite.damaged
zstdcat /var/backup/pkg.sql.zstd | pkg shell
pkg check
I found on the forum https://forums.freebsd.org/threads/how-to-recreate-local-sqlite.49057/ something similar.It seems you lost the package/file associatons but then how can pkg still know everything is up to date? It remembers the installed versions anyway?
Looks like that work but are many checksum mismatch and didn't finish yet.. Can I run pkg upgrade -f?See if this helps:
Since it is a VM, first I would run "zpool scrub" to ensure the zpool/zfs structures are consistent and not damaged due to powerfail. Assuming the FS is not damaged (or fixed up), you can try something like the following as root:
You will likely find some issues that you can fix by reinstalling affected packages but the db should be consistent. But Note: follow the above at your own risk.Code:mv /var/db/pkg/local.sqlite /var/db/pkg/local.sqlite.damaged zstdcat /var/backup/pkg.sql.zstd | pkg shell pkg check
I suppose you can though I haven't tried it. If the database is not consistent, I am not sure how well pkg upgrade -f will work. Note that it will reinstall all the packages. One thing you can try is to "pkg install -f" packages with checksum errors & iterate till pkg check -a is clean.
The key thing is to make sure you have a list of all the packages so in the worst case you can always start with a clean slate!
pkg check -ad
Checking all packages: 100%
hi,friend fernandel .what software you have used to record your console ,and make it as gif format ? thanks. i just want to study this ..
multimedia/peekhi,friend fernandel .what software you have used to record your console ,and make it as gif format ? thanks. i just want to study this ..
thanks. study it.