Unix & Linux Stack Exchange is a question and answer site for users of Linux, FreeBSD and other Un*x-like operating systems. 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

When I run synaptic, there are certain packages which synaptic treats as "essential". For example, if I select bash for removal, I will be warned that bash is an "essential package". If I then press the apply button I get a list of packages that are going to be acted on. One of those lists is the list of essential packages that I am about to remove.

Using the apt toolset, how can I vgenerate a list of all the packages that synaptic considers essential?

share|improve this question
up vote 5 down vote accepted

You can list all essential packages using aptitude search '?essential' or dpkg-query -Wf '${Package;-40}${Essential}\n' | grep yes.

Additionally there are also several packages with priority required that you shouldn't remove, too: dpkg-query -Wf '${Package;-40}${Priority}\n' | grep -E "required"

For your information, Essential and Priority are fields in the control file of a package.

share|improve this answer
aptitude search ~E

for other search patterns you can look in aptitude doc.

share|improve this answer

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.