Take the 2-minute tour ×
Ask Ubuntu is a question and answer site for Ubuntu users and developers. It's 100% free, no registration required.

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

1 Answer 1

up vote 4 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

 
discard

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.