Improve MongoDB repo setup for unknown Debian releases
Fallback to 'bookworm' for unknown Debian releases and update repository verification to check the correct nested path for MongoDB. Also adjust the sources.list format to match the new repository structure.
This commit is contained in:
parent
e6bd1b5759
commit
2ae62055a6
@ -2399,19 +2399,17 @@ function setup_mongodb() {
|
|||||||
SUITE="buster"
|
SUITE="buster"
|
||||||
;;
|
;;
|
||||||
*)
|
*)
|
||||||
# Fallback: try the codename itself
|
# Fallback: try bookworm for unknown releases
|
||||||
SUITE="$DISTRO_CODENAME"
|
msg_warn "Unknown Debian release '${DISTRO_CODENAME}', using bookworm"
|
||||||
|
SUITE="bookworm"
|
||||||
;;
|
;;
|
||||||
esac
|
esac
|
||||||
|
|
||||||
# Verify the repository is available
|
# Verify MongoDB repository is available (MongoDB has nested structure)
|
||||||
if ! verify_repo_available "$MONGO_BASE_URL" "$SUITE"; then
|
if ! curl -fsSL --max-time 10 "${MONGO_BASE_URL}/dists/${SUITE}/mongodb-org/${MONGO_VERSION}/Release" &>/dev/null; then
|
||||||
msg_warn "MongoDB repo not available for ${DISTRO_ID}-${SUITE}, trying bookworm fallback"
|
msg_error "MongoDB ${MONGO_VERSION} repository not available for ${DISTRO_ID}-${SUITE}"
|
||||||
SUITE="bookworm"
|
msg_error "Please check: ${MONGO_BASE_URL}/dists/${SUITE}/mongodb-org/${MONGO_VERSION}/"
|
||||||
if ! verify_repo_available "$MONGO_BASE_URL" "$SUITE"; then
|
return 1
|
||||||
msg_error "MongoDB repository not available for ${DISTRO_ID}-${DISTRO_CODENAME} (tried ${DISTRO_CODENAME} and bookworm)"
|
|
||||||
return 1
|
|
||||||
fi
|
|
||||||
fi
|
fi
|
||||||
|
|
||||||
mkdir -p /etc/apt/keyrings
|
mkdir -p /etc/apt/keyrings
|
||||||
@ -2424,8 +2422,8 @@ function setup_mongodb() {
|
|||||||
cat <<EOF >/etc/apt/sources.list.d/mongodb-org-${MONGO_VERSION}.sources
|
cat <<EOF >/etc/apt/sources.list.d/mongodb-org-${MONGO_VERSION}.sources
|
||||||
Types: deb
|
Types: deb
|
||||||
URIs: ${MONGO_BASE_URL}
|
URIs: ${MONGO_BASE_URL}
|
||||||
Suites: ${SUITE}/mongodb-org/${MONGO_VERSION}
|
Suites: ${SUITE}
|
||||||
Components: main
|
Components: mongodb-org/${MONGO_VERSION}
|
||||||
Architectures: amd64 arm64
|
Architectures: amd64 arm64
|
||||||
Signed-By: /etc/apt/keyrings/mongodb-${MONGO_VERSION}.gpg
|
Signed-By: /etc/apt/keyrings/mongodb-${MONGO_VERSION}.gpg
|
||||||
EOF
|
EOF
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user