Fix openresty suite mapping for Debian 13

Openresty doesn't have trixie packages yet, only bookworm.
Map trixie and sid to use bookworm packages which are compatible.

Available openresty suites: bookworm, bullseye, buster, stretch, jessie
Fixes 404 errors when installing/updating on Debian 13 Trixie
This commit is contained in:
CanbiZ
2026-01-05 14:57:40 +01:00
parent 0fb5fc5ce0
commit 259f14b8e9
2 changed files with 12 additions and 2 deletions

View File

@@ -159,10 +159,15 @@ EOF
[ ! -f /etc/apt/trusted.gpg.d/openresty.gpg ] && curl -fsSL https://openresty.org/package/pubkey.gpg | gpg --dearmor --yes -o /etc/apt/trusted.gpg.d/openresty.gpg
if [ ! -f /etc/apt/sources.list.d/openresty.sources ]; then
DEBIAN_VERSION=$(grep -E '^VERSION_CODENAME=' /etc/os-release | cut -d'=' -f2)
# Openresty only has bookworm, not trixie - map newer versions to bookworm
case "$DEBIAN_VERSION" in
trixie|sid) OPENRESTY_SUITE="bookworm" ;;
*) OPENRESTY_SUITE="$DEBIAN_VERSION" ;;
esac
cat <<EOF >/etc/apt/sources.list.d/openresty.sources
Types: deb
URIs: http://openresty.org/package/debian/
Suites: ${DEBIAN_VERSION}
Suites: ${OPENRESTY_SUITE}
Components: openresty
Signed-By: /etc/apt/trusted.gpg.d/openresty.gpg
EOF

View File

@@ -42,10 +42,15 @@ msg_ok "Set up Certbot"
msg_info "Installing Openresty"
curl -fsSL "https://openresty.org/package/pubkey.gpg" | gpg --dearmor -o /etc/apt/trusted.gpg.d/openresty.gpg
DEBIAN_VERSION=$(grep -E '^VERSION_CODENAME=' /etc/os-release | cut -d'=' -f2)
# Openresty only has bookworm, not trixie - map newer versions to bookworm
case "$DEBIAN_VERSION" in
trixie|sid) OPENRESTY_SUITE="bookworm" ;;
*) OPENRESTY_SUITE="$DEBIAN_VERSION" ;;
esac
cat <<EOF >/etc/apt/sources.list.d/openresty.sources
Types: deb
URIs: http://openresty.org/package/debian/
Suites: ${DEBIAN_VERSION}
Suites: ${OPENRESTY_SUITE}
Components: openresty
Signed-By: /etc/apt/trusted.gpg.d/openresty.gpg
EOF