1

I have made a backup of my entire computer and I reinstalled the OS right now. I know I should have listed dpkg -l to obtain a list of packages, but I have not done so. I only made a tarball of the entire disk.

I wonder how I can find a list of packages based on this data. I would like to have the same packages installed that I had on my previous set-up. But there seems no longer a way to gain a list of packages, since I already reinstalled Ubuntu on the computer and only have the tarball back-up.

3

You can try to chroot to your backup and then execute your command. This will require that you extract your backup to disk.

Suppose you extracted your backup to a directory called backup in your home folder. Then execute the following commands:

$ cd ~/backup
$ sudo chroot .

This should let you execute commands in the current terminal that use your backup system. Then you could get a list of packages using dpkg -l or dpkg --get-selections

$ dpkg --get-selections > /package_list.txt

After you are done, just exit the chroot:

$ exit

You can then get the package listings in ~/backup/package_list.txt.

I haven't tried this by myself (i don't have a backup to chroot) but it should work.

Your Answer

By clicking "Post Your Answer", you acknowledge that you have read our updated terms of service, privacy policy and cookie policy, and that your continued use of the website is subject to these policies.

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