I'm running 13.04 on VMWare Fusion 6 on top of OS X, which has some serious stability problems, necessitating hard reboots (power cycling) at least once/day if not more.

Since VMWare is lame and doesn't always write disk data to disk, it is very easy for virtual machines to get damaged when someone restarts the machine without shutting down the VM.

At any rate, I've got a virtual disk from my old VM which can be mounted in a new install, but I don't know how to get a list of installed packages, since dpkg is looking at its new database and doesn't care about the old one.

There are a lot of issues with the old partition, files corrupted and such, so I can't just dd it to a new location. I figure the easiest way forward is to compile a list of packages I added post-install, then feed it to dpkg and apt-get as in this answer. My only problem is generating that list of packages. Can anyone help?

1 Answer 1


If you can mount the virtual disk enough to see the /var/lib/dpkg/ directory, you can tell dpkg to look there with the "--admindir" option.

dpkg --admindir=/mountpoint/var/lib/dpkg --list

The only file that is really needed is /var/lib/dpkg/status (or one of its backups). So you could copy that single file to an empty directory and point dpkg at that directory.

  • thank you very much! I was thinking no one had seen my question!
    – MattDMo
    Oct 12, 2013 at 17:44

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.