- need_packages_lw="snapd"
- echo -e "Checking required packages: $need_packages_lw"
- dpkg -l $need_packages_lw &>/dev/null \
- || ! echo -e "One or several required packages are not installed. Updating apt cache requires root privileges." \
- || sudo apt-get update \
- || FATAL "failed to run apt-get update"
- dpkg -l $need_packages_lw &>/dev/null \
- || ! echo -e "Installing $need_packages_lw requires root privileges." \
- || sudo apt-get install -y $need_packages_lw \
- || FATAL "failed to install $need_packages_lw"