Skip to content

Instantly share code, notes, and snippets.

@numbnet
Created September 8, 2021 20:06
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 numbnet/27f517ec0ce2556e0acd1ce9720b7df6 to your computer and use it in GitHub Desktop.
Save numbnet/27f517ec0ce2556e0acd1ce9720b7df6 to your computer and use it in GitHub Desktop.
## ::::::::::::::::::::::::::::::::::::::::::::::::::::::::
##
PKG="nano";
# read -p "ENTER name install PKG: " insPKG;
if [ "$(dpkg-query -W -f='${Status}' "$PKG" 2>/dev/null | grep -c "ok installed")" == "1" ]; then
echo "$PKG OK"
else
apt update -q4;
apt -y install "$PKG";
fi;
## ::::::::::::::::::::::::::::::::::::::::::::::::::::::::
##
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment