Last active
May 30, 2017 12:39
-
-
Save nathanchere/b3c65ff10b0b5aedb24c4e2cb5bfabe5 to your computer and use it in GitHub Desktop.
Check if a package is installed or not in Arch
This file contains hidden or 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
#!/usr/bin/env bash | |
packageName="libssl" | |
pacman -Qi "$packageName" &> /dev/null | |
if [ $? -eq 0 ]; then | |
echo "Package '$packageName' is installed" | |
fi | |
if [ ! $? -eq 0 ]; then | |
echo "Package '$packageName' is not installed" | |
fi |
This file contains hidden or 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
#!/usr/bin/env bash | |
isPackageInstalled() { | |
pacman -Qi "$packageName" &> /dev/null | |
echo $? | |
} | |
if [ isPackageInstalled('stow') ]; then | |
echo 'Package is installed' | |
fi |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment