From a0c74b614d386e8b0d1018188ca622130ed64e71 Mon Sep 17 00:00:00 2001 From: Jon Pruente Date: Fri, 18 Sep 2020 11:32:07 -0500 Subject: [PATCH] Add Debian 10 Buster support to the MongoDB installer. --- scripts/install_mongo.sh | 4 +++- scripts/install_mongodb_deb10.sh | 39 ++++++++++++++++++++++++++++++++ 2 files changed, 42 insertions(+), 1 deletion(-) create mode 100755 scripts/install_mongodb_deb10.sh diff --git a/scripts/install_mongo.sh b/scripts/install_mongo.sh index 68c268cc..bf948e97 100755 --- a/scripts/install_mongo.sh +++ b/scripts/install_mongo.sh @@ -1,7 +1,7 @@ #!/bin/bash # Install MongoDB for the appropriate OS and version. -# Supports Ubuntu 14, 16, 18 and RHEL/CentOS 6.9 +# Supports Ubuntu 14, 16, 18, Debian 10 Buster, and RHEL/CentOS 6.9 set -e set -x @@ -14,6 +14,8 @@ if [ -f /etc/debian_version ]; then ./install_mongodb_ub16.sh elif [ "$(lsb_release -r -s)" == "18.04" ]; then ./install_mongodb_ub18.sh + elif [ "$(lsb_release -r -s)" == "10" ]; then + ./install_mongodb_deb10.sh else echo -e "ERROR: Unknown OS\nExiting!" exit -1 diff --git a/scripts/install_mongodb_deb10.sh b/scripts/install_mongodb_deb10.sh new file mode 100755 index 00000000..91e2f8eb --- /dev/null +++ b/scripts/install_mongodb_deb10.sh @@ -0,0 +1,39 @@ +#!/bin/bash + +# Install MongoDB for Debian 10 Buster. + +[[ "$( lsb_release -i -s )" != "Debian" ]] && [[ "$( lsb_release -r -s )" != "10" ]] && echo "Not Debian 10 - Exiting" && exit -1 + +set -e +set -x + +# Based on instructions from https://docs.mongodb.com/manual/tutorial/install-mongodb-on-debian/ and the MHN Ubuntu 16.04 LTS install_mongodb_ub16.sh script + +PACKAGES="gnupg" +MISSING=$(dpkg --get-selections $PACKAGES 2>&1 | grep -v 'install$' | awk '{ print $6 }') +[[ ! -z "$MISSING" ]] && apt install $MISSING + +wget -qO - https://www.mongodb.org/static/pgp/server-4.4.asc | apt-key add - + +echo "deb http://repo.mongodb.org/apt/debian buster/mongodb-org/4.4 main" | tee /etc/apt/sources.list.d/mongodb-org-4.4.list + +apt update && apt install -y mongodb-org + +sed -i 's/127.0.0.1/0.0.0.0/g' /etc/mongod.conf + +cat > /etc/systemd/system/mongodb.service <