30

After executing the aptitude search pattern command, I need to see only installed packages in the search result. Is there any way to do that?

B Faley
  • 4,213
  • 11
  • 37
  • 48

2 Answers2

43

Add ~i (short for ?installed) to match the installed packages whose name contains bash:

aptitude search '~i bash'

To match whose description contains bash.

aptitude search '~i ~d bash'

To limit to the ones that are not installed:

aptitude search '!~i bash'
Luten
  • 103
  • 5
Stéphane Chazelas
  • 522,931
  • 91
  • 1,010
  • 1,501
4

I usually do dpkg -l|fgrep …. Does it count?

UPD.: aptitude search '?narrow(?installed, …)'

(But I seem to prefer dpkg -l anyway) ;)

poige
  • 6,195
  • 2
  • 30
  • 57