Skip to content

Instantly share code, notes, and snippets.

@chenwaichung
Created May 9, 2019 10:42
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 chenwaichung/6701f6ecc11fdf5a9f0a13201969723a to your computer and use it in GitHub Desktop.
Save chenwaichung/6701f6ecc11fdf5a9f0a13201969723a to your computer and use it in GitHub Desktop.
use dpkg-query check package is installed?
#!/bin/bash
pkgs=automake
if dpkg-query -l ${pkgs} >/dev/null 2>&1; then
echo "${pkgs} is installed."
else
echo "${pkgs} not installed."
fi
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment