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>
# 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
}