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 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.

share|improve this question
add comment

1 Answer

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.

share|improve this answer
add comment

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.