Ask Ubuntu is a question and answer site for Ubuntu users and developers. 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

If I want to know if skype is installed, I would type this:

viggy@ubuntu:~$ apt-cache policy skype
  Version table:
 *** 0
        100 /var/lib/dpkg/status

Or if Eclipse is installed:

viggy@ubuntu:~$ apt-cache policy eclipse
  Installed: (none)
  Candidate: 3.7.2-1
  Version table:
     3.7.2-1 0

But let's say I want to know if the Java Virtual Machine is installed. How would I know what to pass to apt-cache policy? For example, you might not know what to pass to apt-cache policy for some programs:

viggy@ubuntu:~$ apt-cache policy java
N: Unable to locate package java
viggy@ubuntu:~$ apt-cache policy JVM
N: Unable to locate package JVM
share|improve this question
up vote 1 down vote accepted

You can search for a program title using the following command:

apt-cache search TitleYouWant

This will search for any package that has the word in it. Update the apt-get list of packages first using:

sudo apt-get update
share|improve this answer

If you have installed openjdk then use

apt-cache policy openjdk*

In case of sun-java use

apt-cache policy sun-java*

This will show the version of java installed in your machine

Hope this helps

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.