Last active
June 18, 2021 07:09
-
-
Save nichollsc81/c2ad27a2d5d34d22520a9044d8056f16 to your computer and use it in GitHub Desktop.
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
#!/bin/bash | |
## declare array | |
declare -a REQUIRED_PKGS=("dnsutils" "nano") | |
# iterate over array | |
for i in "${REQUIRED_PKGS[@]}"; | |
do | |
# if installed then remove | |
if [ "$(dpkg -l | grep $i)" ]; then | |
sudo apt-get purge --auto-remove ${i} -y #--simulate | |
fi | |
done |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment