Ask Ubuntu is a question and answer site for Ubuntu users and developers. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

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?

share|improve this question
up vote 5 down vote accepted

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.

share|improve this answer
thank you very much! I was thinking no one had seen my question! – MattDMo Oct 12 '13 at 17:44

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

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