Debian: Get list of installed packages while in rescue mode
Solution 1:
If the filesystem that you are recovering from is in a good state and wasn't malware infected or something, then just try doing a chroot /mnt /bin/bash
, that should give you a shell that is in the rescued filesystem. From there you could do a dpkg --get-selections > packages
.
You can also give the --admindir=dir
option to dpkg to point at another directory. So you should be able to do something like dpkg --admindir=/mnt/var/lib/dpkg --get-selections