install_dependencies() {
echo "Updating system and installing dependencies..."
# Set environment variable to prevent prompts
export DEBIAN_FRONTEND=noninteractive
# Automatically select default options using -y and avoid interactive prompts
apt-get update -y && apt-get upgrade -y
# Check if make is installed
if ! command -v make &> /dev/null; then
echo "make could not be found"
echo "Installing make..."
apt-get install -y make
fi
# Check if gcc is installed
if ! command -v gcc &> /dev/null; then
echo "gcc could not be found"
echo "Installing gcc..."
apt-get install -y gcc
fi
# Check if jq is installed
if ! command -v jq &> /dev/null; then
echo "jq could not be found"
echo "Installing jq..."
apt-get install -y jq
fi
# Unset the environment variable after use
unset DEBIAN_FRONTEND
}
Suggested code change