From 5717d2f4a8d8952951931c26a971ae56fe4941fc Mon Sep 17 00:00:00 2001 From: billz Date: Mon, 25 Mar 2024 19:47:19 +0100 Subject: [PATCH] Update package check w/ dpkg-query --- installers/common.sh | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/installers/common.sh b/installers/common.sh index 99499a82..2a3360af 100755 --- a/installers/common.sh +++ b/installers/common.sh @@ -149,12 +149,12 @@ function _check_incompatible_distro() { local status_err="Unsupported Desktop distro detected. Please see the docs." echo "OS compatibility check" if [ "$distro" == "Debian" ]; then - if ! dpkg -l raspberrypi-ui-mods &> /dev/null; then + if ! dpkg-query -W -f='${Status}' raspberrypi-ui-mods 2>/dev/null | grep -q 'not-installed'; then _install_status 1 "$status_err" exit 0 fi elif [ "$distro" == "Ubuntu" ]; then - if ! dpkg -l ubuntu-mate-core &> /dev/null || dpkg -l ubuntu-desktop &> /dev/null; then + if ! dpkg-query -W -f='${Status}' ubuntu-desktop 2>/dev/null | grep -q 'not-installed'; then _install_status 1 "$status_err" exit 0 fi