diff --git a/linux.d/debian b/linux.d/debian index bc4e712c57..10d866fcb5 100644 --- a/linux.d/debian +++ b/linux.d/debian @@ -28,12 +28,16 @@ REQUIRED_DEV_PACKAGES=( if [[ -n "$UPDATE_LIB" ]] then - # for ubuntu 22+ and 23+: - ubu_major_version="$(grep VERSION_ID /etc/os-release | cut -d "=" -f 2 | cut -d "." -f 1 | tr -d /\"/)" - if [ $ubu_major_version == "22" ] || [ $ubu_major_version == "23" ] - then - REQUIRED_DEV_PACKAGES+=(curl libfuse-dev libssl-dev libcurl4-openssl-dev m4) + source /etc/os-release + if [ "${ID}" == "ubuntu" ] && [ -n "${VERSION_ID}" ]; then + # It's ubuntu and we have a VERSION_ID like "24.04". + if dpkg --compare-versions "${VERSION_ID}" ge 22 && dpkg --compare-versions "${VERSION_ID}" lt 24 ; + then + # Some extra packages needed on Ubuntu 22.x and 23.x: + REQUIRED_DEV_PACKAGES+=(curl libfuse-dev libssl-dev libcurl4-openssl-dev m4) + fi fi + if [[ -n "$BUILD_DEBUG" ]] then REQUIRED_DEV_PACKAGES+=(libssl-dev libcurl4-openssl-dev)