Contents of /var was lost.
Is the question of the title possible ?
Is the question of the title possible ?
Don’t you have a regular backup of that machine? You can simply recover /var/db/pkg from your latest backup.Lol. Luckely i have found a two months old "pkg info" output .
In fact I'll write a daily "pkg info" script in crontab. Lessons learned.
( cat old_system.list | \
while read old_file
do
pkg which $old_file | \
awk '{print $NF}'
done ) | \
sort | uniq -c
Well, then he wouldn't have asked...Don’t you have a regular backup of that machine? You can simply recover /var/db/pkg from your latest backup.
... when you make themAlain De Vos when do you switch to ZFS? There you have snapshots to recover from human mistakes.
Loosely based on my backup:In fact I'll write a daily "pkg info" script in crontab.
pkg info > /path/to/mount/packages_all.txt
pkg query -e '%a = 0' %o > /path/to/mount/packages_base.txt
pkg query -e '%#r == 0' '%n-%v' > /path/to/mount/packages_nodeps.txt
pkg info
is the least important - would only result in having packages restored as manually installed while they were automatic before. Only makes sense for a final comparison. But the other two are also great to set up new machines I find descriptive aliases for leaf & prime-* inLoosely based on my backup:
pkg info > /path/to/mount/packages_all.txt
pkg query -e '%a = 0' %o > /path/to/mount/packages_base.txt
pkg query -e '%#r == 0' '%n-%v' > /path/to/mount/packages_nodeps.txt
pkg info
is the least important - would only result in having packages restored as manually installed while they were automatic before. Only makes sense for a final comparison. But the other two are also great to set up new machines![]()
pkg alias
. IMHO better use these, especially in a posting, because we can quickly guess what these commands do, instead of looking it up by pkg help query
.Please post that script to Usefull Scripts?My root user has an "install.sh" script which contains all the commands I use for installing. One only needs to add to it. It also takes care of ports with changed flags or versions, like lame and drm-kmod.
Just my 2c.