From 1c7662f7f107496d9a3cf308da8d63685ac2e9fc Mon Sep 17 00:00:00 2001 From: Vinfall Date: Thu, 20 Oct 2022 13:19:43 +0800 Subject: [PATCH 1/3] `apt-key` is deprecated, move keyring to trusted.gpg.d --- tools/setup.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tools/setup.sh b/tools/setup.sh index c90ddbc..c4809ef 100644 --- a/tools/setup.sh +++ b/tools/setup.sh @@ -25,7 +25,7 @@ else exit 1 fi -wget -qO - https://www.mongodb.org/static/pgp/server-5.0.asc | sudo apt-key add - +wget -qO - https://www.mongodb.org/static/pgp/server-5.0.asc | sudo tee /etc/apt/trusted.gpg.d/mongodb-server-5.0.asc echo "deb [ arch=amd64,arm64 ] $REPO" | sudo tee /etc/apt/sources.list.d/mongodb-org-5.0.list sudo apt update From 2ac153854949653ad92615bc8de06b012eaba4a9 Mon Sep 17 00:00:00 2001 From: Vinfall Date: Thu, 20 Oct 2022 13:20:10 +0800 Subject: [PATCH 2/3] MongoDB only support Ubuntu LTS --- tools/setup.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tools/setup.sh b/tools/setup.sh index c4809ef..2a6bd0d 100644 --- a/tools/setup.sh +++ b/tools/setup.sh @@ -8,7 +8,7 @@ if [[ -r /etc/os-release ]]; then . /etc/os-release if [[ $ID = ubuntu ]]; then if [[ $VERSION_CODENAME = impish ]]; then - VERSION_CODENAME=focal # MongoDB does not provide packages for Ubuntu 21.10 + VERSION_CODENAME=focal # MongoDB does not provide packages for Ubuntu 22.04 LTS yet fi REPO="https://repo.mongodb.org/apt/ubuntu $VERSION_CODENAME/mongodb-org/5.0 multiverse" elif [[ $ID = debian ]]; then From f9b540a84cd7c3bcdf885cd5ed5b587f91ee2252 Mon Sep 17 00:00:00 2001 From: Vinfall <91039000+Vinfall@users.noreply.github.com> Date: Fri, 21 Oct 2022 02:09:32 +0000 Subject: [PATCH 3/3] Update setup.sh Ubuntu 21.10 has reached EOF and is kept for backward-compatibility, see https://wiki.ubuntu.com/Releases. Add Debian testing/unstable support. --- tools/setup.sh | 16 ++++++++++------ 1 file changed, 10 insertions(+), 6 deletions(-) diff --git a/tools/setup.sh b/tools/setup.sh index 2a6bd0d..55cf8d3 100644 --- a/tools/setup.sh +++ b/tools/setup.sh @@ -7,14 +7,18 @@ sudo apt install -y git python3-pip python3-virtualenv python3-venv nginx ffmpeg if [[ -r /etc/os-release ]]; then . /etc/os-release if [[ $ID = ubuntu ]]; then - if [[ $VERSION_CODENAME = impish ]]; then - VERSION_CODENAME=focal # MongoDB does not provide packages for Ubuntu 22.04 LTS yet - fi + # MongoDB supports only LTS and has not released package for Ubuntu 22.04 LTS yet + case $VERSION_CODENAME in + impish|kinetic|jammy) + VERSION_CODENAME=focal ;; + esac REPO="https://repo.mongodb.org/apt/ubuntu $VERSION_CODENAME/mongodb-org/5.0 multiverse" elif [[ $ID = debian ]]; then - if [[ $VERSION_CODENAME = bullseye ]]; then - VERSION_CODENAME=buster # MongoDB does not provide packages for Debian 11 yet - fi + # MongoDB does not provide packages for Debian 11 yet + case $VERSION_CODENAME in + bullseye|bookworm|sid) + VERSION_CODENAME=buster ;; + esac REPO="https://repo.mongodb.org/apt/debian $VERSION_CODENAME/mongodb-org/5.0 main" else echo "Unsupported distribution $ID"