diff --git a/lib/lib_check_pkgs.sh b/lib/lib_check_pkgs.sh index ffca3b8..1a0dc80 100644 --- a/lib/lib_check_pkgs.sh +++ b/lib/lib_check_pkgs.sh @@ -16,6 +16,22 @@ # None ####################################### check_pkgs() { + if [[ -z "$(command -v lsb_release || true)" ]]; then + apt-get update -y + apt-get install --no-install-recommends lsb-release -y + fi + + if [[ -z "$(command -v debootstrap || true)" ]]; then + if grep -RqsE '^[[:space:]]*deb .*backports' /etc/apt/sources.list /etc/apt/sources.list.d; then + apt-get update -y + # shellcheck disable=SC2155 + declare codename=$(lsb_release -sc) + apt-get -t "${codename}-backports" install debootstrap -y + else + apt-get install debootstrap -y + fi + fi + if [[ ! -f /usr/share/live/build/VERSION ]]; then apt-get update -y apt-get install live-build -y