From 04691123ed5f0c34afca25cba63b9609f2490d9b Mon Sep 17 00:00:00 2001 From: luo rixin Date: Fri, 19 Jan 2024 10:53:04 +0800 Subject: [PATCH] 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 --- install-deps.sh | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/install-deps.sh b/install-deps.sh index d01bc6464e6..a334a3b29a3 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 } -- 2.39.5