Skip to content

Commit 1269ed7

Browse files
authored
get-stack.sh: fix apt package detection (fixes #4816)
1 parent d8e942e commit 1269ed7

File tree

1 file changed

+8
-2
lines changed

1 file changed

+8
-2
lines changed

etc/scripts/get-stack.sh

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -610,9 +610,15 @@ try_install_pkgs() {
610610

611611
# Install packages using apt-get
612612
apt_get_install_pkgs() {
613-
if ! dpkg-query -W "$@"|grep -v '^\S\+\s\+.\+$' > /dev/null; then
613+
missing=
614+
for pkg in $*; do
615+
if ! dpkg -s $pkg 2>/dev/null |grep '^Status:.*installed' >/dev/null; then
616+
missing="$missing $pkg"
617+
fi
618+
done
619+
if [ "$missing" = "" ]; then
614620
info "Already installed!"
615-
elif ! sudocmd "install required system dependencies" apt-get install -y ${QUIET:+-qq} "$@"; then
621+
elif ! sudocmd "install required system dependencies" apt-get install -y ${QUIET:+-qq}$missing; then
616622
die "Installing apt packages failed. Please run 'apt-get update' and try again."
617623
fi
618624
}

0 commit comments

Comments
 (0)