Is a list of selected packages stored in the file system?

I have a backup of my Ubuntu computer stored on my iMac. My hard disk died and I want get a list of the packages that was installed by just reading from the file system and without running commands like dpkg --get-selections


Solution 1:

You can do it by reading /var/lib/dpkg/status from your backup.

In my running Ubuntu:

grep '^Package:' /var/lib/dpkg/status | cut -f2 -d' '

Solution 2:

grep "Package" /var/lib/dpkg/status > Package.list should do the trick