Created
January 14, 2020 00:31
-
-
Save awesome/72d007979e2b2639d32a508fc76a66c2 to your computer and use it in GitHub Desktop.
"Dpkg: check that unix package is installed. Bash script: install package if not present" via https://www.thinkplexx.com/learn/howto/linux/packaging/dpkg-check-that-unix-package-is-installed-example-install-package-if-not-present
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Dpkg: check that unix package is installed. Bash script: install package if not present | |
By neokrates, written on May 21, 2010 | |
Was the package already installed or it still needs to be? | |
Software: | |
✔ Ubuntu * | |
dpkg -s can be used. | |
# Example: is libasound installed? | |
dpkg -s libasound2|grep installed | |
# Here is some logic in bash script, like installing package if it is not there: | |
problem=$(dpkg -s xulrunner-1.9|grep installed) | |
echo Checking for libxul: $problem | |
if [ "" == "$problem" ]; then | |
echo "No libxul. Setting up libxul" | |
sudo apt-get --force-yes --yes install xulrunner-1.9 | |
fi |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment