Horje
bash check if package is installed Code Example
bash check if package is installed
REQUIRED_PKG="some-package"
PKG_OK=$(dpkg-query -W --showformat='${Status}\n' $REQUIRED_PKG|grep "install ok installed")
echo Checking for $REQUIRED_PKG: $PKG_OK
if [ "" = "$PKG_OK" ]; then
  echo "No $REQUIRED_PKG. Setting up $REQUIRED_PKG."
  sudo apt-get --yes install $REQUIRED_PKG 
fi




Shell

Related
git pull hard Code Example git pull hard Code Example
add user to sudoers ubuntu 20.04 Code Example add user to sudoers ubuntu 20.04 Code Example
git replace local branch with remote Code Example git replace local branch with remote Code Example
delete aws configure in mac cli Code Example delete aws configure in mac cli Code Example
git same as origin master Code Example git same as origin master Code Example

Type:
Code Example
Category:
Coding
Sub Category:
Code Example
Uploaded by:
Admin
Views:
11