Last active
August 8, 2024 07:37
-
-
Save realyukii/c5eda5f17939bcab339c848d035ca9ad to your computer and use it in GitHub Desktop.
Check if the required packages are installed or not on your arch linux system; the script was originally intended for https://wiki.lineageos.org/emulator
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
#!/bin/bash | |
# Define the list of packages | |
packages=( | |
bc bison ccache curl flex git git-lfs gnupg gperf imagemagick | |
lib32-readline lib32-zlib libelf liblz4 libsdl2 libssl libxml2 | |
lzop rsync schedtool squashfs-tools xsltproc zip zlib | |
) | |
# Initialize an empty array to hold missing packages | |
missing_packages=() | |
# Loop through each package to check if it is installed | |
for pkg in "${packages[@]}"; do | |
if pacman -Qs $pkg > /dev/null; then | |
echo "$pkg is installed." | |
else | |
echo "$pkg is NOT installed." | |
missing_packages+=($pkg) | |
fi | |
done | |
# Print the missing packages, if any | |
if [ ${#missing_packages[@]} -ne 0 ]; then | |
echo "The following packages are missing:" | |
for missing in "${missing_packages[@]}"; do | |
echo $missing | |
done | |
else | |
echo "All packages are installed." | |
fi |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment