Tugger the SLUGger!SLUG Mailing List Archives

Re: [SLUG] easiest way to check if a .deb is installed?


On Sat, Jun 7, 2008 at 4:21 PM, Sonia Hamilton <sonia@xxxxxxxxxxxx> wrote:
> What's the easiest accurate way to check if a .deb has been installed
> on a system, from a script?
>
> At the moment I'm using `dpkg -l | grep ...`, which is messy.

dpkg -s $package
Return code is 0 for installed, 1 for not installed.

Lindsay


-- 
http://slug.org.au/ (the Sydney Linux Users Group)
http://holmwood.id.au/~lindsay/ (me)