how can i use shell to judge the software was installed?
<p>My pc's os is ubuntu 14.04, I want  write a  script  to auto install some software, I  need  to judge it was not installed before,  for exeample ,I want 
judge  google-chrome  was installed or not,code like this:</p>

<pre><code>if [ !which google-chrome  #I knoe this  way was wrong]
do
     download it 
     sudo dpkg  -i  google-chrome*.deb
done 
fi
</code></pre>

<p>I know  the judge code  if[] is wrong, can you tell me  how  can  I judge  it was not installed use shell ?</p>