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

  • What's wrong with dkpg --get-selections? – zondo Apr 5 '17 at 16:39
  • I do not have shell access to the machine, because my machine is broken and I just have the file system. – tjespe Apr 5 '17 at 16:40

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' '
  • Your welcome ;) – Ravexina Apr 5 '17 at 16:42
  • Nice edit, I was about to point you here – Elder Geek Apr 5 '17 at 16:50

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

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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