List of installed Debian packages - but with a twist

456 views Asked by At

I have an old Debian box that I used heavily over a long period of time that will no longer boot cleanly, so I pulled out a new Ubuntu Live CD to give it a second chance at life. I backed up all my files, but now I want to review what packages I had installed. Problem: It appears that the dpkg maintainers only expect a person to do this from the operating system in question, rather than a parasitic Live CD. The end result is a complete lack of Google results of how to do this.

I'm going to try figuring out which files dpkg reads given the --list option, and then transplanting the proper files, but I'd prefer there to be a better option than what I plan on doing.

Any ideas?

1

There are 1 answers

0
bdonlan On BEST ANSWER

All you need to do is chroot into the filesystem you backed up, and run dpkg -la from there. You can also do dpkg -la --root=/your/backup/dir without chrooting.

If it's inconvenient to extract the filesystem in a way that lets you chroot into it, then the file you're looking for is /var/lib/dpkg/status. The format is fairly self-explanatory; packages that are installed will be listed as Status: install ok installed.