Re: checking whether a package is installed
Aaron Maxwell <amaxwell@phy.ucsf.edu> writes:
> Is there a quick, elegant way to check if a particular package is
> installed?
dpkg -l <package>
You can use shell wildcards if you quote, e.g. dpkg -l 'dpkg-p*'. This
gives (depending on your dpkg caches) something like
Desired=Unknown/Install/Remove/Purge/Hold
| Status=Not/Installed/Config-files/Unpacked/Failed-config/Half-installed
|/ Err?=(none)/Hold/Reinst-required/X=both-problems (Status,Err: uppercase=bad)
||/ Name Version Description
+++-==============-==============-============================================
ii dpkg-perl 0.1-3.0 Perl interface modules for dpkg
pn dpkg-python <none> (no description available)
from which you can easily see what is installed. In my case I want
(column 1) and have (column 2) installed dpkg-perl. The perl-python
package I want purged and is not installed.
Very quick, very elegant. Not?
--
Olaf Meeuwissen Epson Kowa Corporation, Research and Development
Reply to: