diff --git a/scripts/_common.sh b/scripts/_common.sh index 83df98e..45c42eb 100644 --- a/scripts/_common.sh +++ b/scripts/_common.sh @@ -329,7 +329,14 @@ ynh_install_mongo() { ynh_print_info --message="Installing MongoDB Community Edition ..." local mongo_debian_release=$(ynh_get_debian_release) - if [ "$mongo_debian_release" == bullseye ] ; then + if [[ "$mongo_version" == "4.4" && "$mongo_debian_release" != "buster" ]]; then + ynh_print_warn --message="Switched to buster install as Mongo 4.4 is not compatible with $mongo_debian_release." + mongo_debian_release=buster + fi + + if [ "$mongo_debian_release" == buster ] ; then + ubuntu_version="bionic" + elif [ "$mongo_debian_release" == bullseye ] ; then ubuntu_version="focal" elif [ "$mongo_debian_release" == bookworm ] ; then ubuntu_version="jammy" @@ -338,7 +345,9 @@ ynh_install_mongo() { if [[ $(cat /proc/cpuinfo) != *"avx"* && "$mongo_version" != "4.4" ]]; then ynh_print_warn --message="Installing Mongo 4.4 as $mongo_version is not compatible with your cpu (see https://docs.mongodb.com/manual/administration/production-notes/#x86_64)." mongo_version="4.4" - fi + fi + + ynh_install_extra_app_dependencies \ --repo="deb [ arch=amd64,arm64 ] https://repo.mongodb.org/apt/ubuntu $ubuntu_version/mongodb-org/$mongo_version multiverse" \