From: luo rixin Date: Fri, 19 Jan 2024 02:53:04 +0000 (+0800) Subject: install-deps: Force remove ceph-libboost* packages X-Git-Tag: v19.3.0~179^2 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=refs%2Fpull%2F55240%2Fhead;p=ceph.git install-deps: Force remove ceph-libboost* packages As `apt-get remove ceph-libboost*` show the error and cause the make check failed. `E: The package ceph-libboost1.79-dev needs to be reinstalled, but I can't find an archive for it.` The ceph-libboost* packages may be not removed, so use `dpkg` to force remove ceph-libboost*. Fixes: https://tracker.ceph.com/issues/64032 Signed-off-by: luo rixin --- diff --git a/install-deps.sh b/install-deps.sh index d01bc6464e6f..a334a3b29a30 100755 --- a/install-deps.sh +++ b/install-deps.sh @@ -177,6 +177,14 @@ function clean_boost_on_ubuntu { # so no need to spare it. if test -n "$installed_ver"; then $SUDO env DEBIAN_FRONTEND=noninteractive apt-get -y --fix-missing remove "ceph-libboost*" + # When an error occurs during `apt-get remove ceph-libboost*`, ceph-libboost* packages + # may be not removed, so use `dpkg` to force remove ceph-libboost*. + local ceph_libboost_pkgs=$(dpkg -l | grep ceph-libboost* | awk '{print $2}' | + awk -F: '{print $1}') + if test -n "$ceph_libboost_pkgs"; then + ci_debug "Force remove ceph-libboost* packages $ceph_libboost_pkgs" + $SUDO dpkg --purge --force-all $ceph_libboost_pkgs + fi fi }