Ubuntu – Find if a package is installed


Ubuntu 9.10

I am wondering what apt-cache show emacs.

However, it gives information about emacs but doesn't show if it is currently installed or not.

How can I find if a package and version is currently installed?

Many thanks,

Best Answer

  • Use dpkg:

    dpkg -s emacs

    there is also dpkg-query which allows you to use wildcards in your search:

    dpkg-query -l '*emacs*'