I'm trying to rebuild a Debian system from a recent backup.
All the recipes for doing this that I've found begin with a step of the form
dpkg --get-selections > package_list
This, of course, must be done on the original system, while all I have is an rsync backup on an external drive. This backup, however, includes all of /etc and most1 of /var.
Is there a convenient way to replicate/approximate the output of dpkg --get-selections from the contents of /etc and /var?
1 Excluded from the backup are /var/{tmp,run,lock}.