How can I know if a virtual package is "installed" on a Debian system?

To list packages providing mail-transport-agent:

$ aptitude search '~Pmail-transport-agent'
p   citadel-mta                     - complete and feature-rich groupware server
p   courier-mta                     - Courier mail server - ESMTP daemon        
p   dma                             - lightweight mail transport agent          
p   esmtp-run                       - user configurable relay-only MTA - the reg
p   exim4-daemon-heavy              - Exim MTA (v4) daemon with extended feature
p   exim4-daemon-light              - lightweight Exim MTA (v4) daemon          
p   masqmail                        - mail transport agent for intermittently co
p   msmtp-mta                       - light SMTP client with support for server 
p   nullmailer                      - simple relay-only mail transport agent    
i   postfix                         - High-performance mail transport agent     
p   sendmail-bin                    - powerful, efficient, and scalable Mail Tra
p   ssmtp                           - extremely simple MTA to get mail off the s
p   xmail                           - advanced, fast and reliable ESMTP/POP3 mai

Make that aptitude search '~Pmail-transport-agent ~i' to only list installed packages (if any).

To list all virtual packages provided by currently installed packages:

aptitude search '~Rprovides:~i ~v'

See the aptitude manual for an explanation of the search patterns.


the problem here is that there is a subtle difference between virtual packages and packages provided by other packages.

the difference is, that a package may provide a real package as well, not only a virtual package.

anyhow, the following will search for all packages that provide a package and will print both the package name and the packages it provides:

grep-available -sPackage  -sProvides -FProvides -e '^.'

to find whether any package is installed on your system that provides a given one (e.g. mail-transport-agent), use

grep-status -sPackage -sProvides -FProvides "mail-transport-agent"