From: Kefu Chai Date: Mon, 23 Dec 2019 08:45:42 +0000 (+0800) Subject: install-deps.sh: use "apt" for checking install status X-Git-Tag: v15.1.0~387^2~3 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=f91adafa4b5cbbabcdc4524c55a46d30c47098fa;p=ceph.git install-deps.sh: use "apt" for checking install status as "dpkg -s " always returns 0 even if the is removed. Signed-off-by: Kefu Chai --- diff --git a/install-deps.sh b/install-deps.sh index 7fdc0209cf24..f141f6f1596c 100755 --- a/install-deps.sh +++ b/install-deps.sh @@ -139,7 +139,7 @@ function install_pkg_on_ubuntu { missing_pkgs="$@" else for pkg in $pkgs; do - if ! dpkg -s $pkg &> /dev/null; then + if ! apt -qq list $pkg 2>/dev/null | grep -q installed; then missing_pkgs+=" $pkg" fi done @@ -154,7 +154,7 @@ function install_pkg_on_ubuntu { function install_boost_on_ubuntu { local codename=$1 - if dpkg -s ceph-libboost1.67-dev &> /dev/null; then + if apt -qq list ceph-libboost1.67-dev 2>/dev/null | grep -q installed; then $SUDO env DEBIAN_FRONTEND=noninteractive apt-get -y remove 'ceph-libboost.*1.67.*' $SUDO rm /etc/apt/sources.list.d/ceph-libboost1.67.list fi