Server Fault is a question and answer site for system and network administrators. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I am looking for a one line command that I could use to list all deb packages that are missing from a newly installed system, packages that are installed on a reference system (old one).

share|improve this question

First, generate the referencelist.txt with dpkg -l > referencelist.txt on the reference machine.

Then your one-liner looks like:

bash -c 'diff <(dpkg -l|sort) <(sort referencelist.txt)'
share|improve this answer
wouldn't you need to sort your referenceslist.txt too ? – Iain Jun 22 '13 at 20:38
... (sort referencelist.txt) ? – dmourati Jun 22 '13 at 23:09
Is it possible to list only the packages that were installed manually and not the dependencies. Quite often we endup having tons on packages that are only dependencies and were not ever installed manually. – sorin Jun 23 '13 at 14:46
Maybe check out debtree – dmourati Jun 24 '13 at 5:05

Your Answer


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.