Skip to content

Instantly share code, notes, and snippets.

@dschneider
Created October 16, 2013 08:44
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save dschneider/7004637 to your computer and use it in GitHub Desktop.
Save dschneider/7004637 to your computer and use it in GitHub Desktop.
Determine whether a package is installed or not in a shell script
if dpkg-query -W mysql-client &> /dev/null; then
echo "INSTALLED"
else
echo "NOT INSTALLED"
fi
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment