I\'m working on a Ubuntu system and currently this is what I\'m doing:
if ! which command > /dev/null; then echo -e \"Command not found! Install? (y/n)
Many things has been told but for me simplest way is:
dpkg -l | grep packagename