]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
install-deps: Force remove ceph-libboost* packages 55240/head
authorluo rixin <luorixin@huawei.com>
Fri, 19 Jan 2024 02:53:04 +0000 (10:53 +0800)
committerluo rixin <luorixin@huawei.com>
Fri, 19 Jan 2024 03:50:30 +0000 (11:50 +0800)
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 <luorixin@huawei.com>
install-deps.sh

index d01bc6464e6f99f893923785ce0325b4f99564dc..a334a3b29a3042f8ecdb8220e4581679c12d90a6 100755 (executable)
@@ -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
 }