At our university we can get almost any ubuntu package installed we want, but we are not superusers ourselves (we need to request packages being installed).

With some libraries it is not always easy to know whether the package is already installed or not. Is there a simple way/command to check this?

link|improve this question

feedback

4 Answers

up vote 11 down vote accepted
apt-cache policy <package name>
link|improve this answer
2  
It's important to know that it supports tab completion in the package name. So it's quite useful even when you don't know the exact package name. – Javier Rivera Aug 23 '10 at 16:28
feedback

I always just use this from the command line:

dpkg -l | grep mysql

so the above asks dpkg to list all the installed packages and then I grep for only those that have mysql in the name.

link|improve this answer
feedback

One more variant, using aptitude this time:

aptitude show <package>

Tab completion works here as well.

link|improve this answer
feedback

You can use dselect. It provides non-su readonly access.

Also, dpkg -s provides a lot of details related to a package. Eg"

userme:~$ dpkg-query -s sl
Package: sl
Status: unknown ok not-installed
Priority: optional
Section: games
link|improve this answer
This is also available as just dpkg -s . And conversely, dpkg-query -l works just as well as dpkg -l or dpkg --list – belacqua Feb 9 '11 at 8:35
feedback

Your Answer

 
or
required, but never shown

Not the answer you're looking for? Browse other questions tagged or ask your own question.