install.sh: OpenResty repo distro/component fix for Debian (#122)
Follow-up to #121: the repo line still used the live codename + "main", but the openresty.org Debian tree only publishes up to bookworm (no trixie) and uses the "openresty" component, not "main". Verified against the repo: /package/debian/dists/ -> bookworm bullseye buster jessie stretch (no trixie) bookworm Release -> Components: openresty /package/ubuntu/dists/ -> noble jammy focal ... ; Components: main So: - Debian: distro = host codename when published (jessie..bookworm), else bookworm (binary-compatible with trixie, same OpenSSL 3 era); component "openresty". - Ubuntu/Mint: distro = host codename; component "main" (unchanged). Produces the working line on a trixie host: deb [...] http://openresty.org/package/debian bookworm openresty docs/installation.md manual steps updated to match. Co-authored-by: Claude <noreply@anthropic.com>
This commit is contained in:
+20
-6
@@ -62,19 +62,33 @@ npm --version
|
|||||||
|
|
||||||
### Step 3: Install OpenResty
|
### Step 3: Install OpenResty
|
||||||
|
|
||||||
openresty.org ships distinct trees for Debian and Ubuntu — use `/package/debian`
|
openresty.org ships distinct trees (and components) for Debian and Ubuntu. The
|
||||||
on Debian and `/package/ubuntu` on Ubuntu (using the Ubuntu tree with a Debian
|
Debian tree is published only up to **bookworm** (there is no trixie block) and
|
||||||
codename worked on older Debian by coincidence; trixie lives under `/debian`).
|
uses the **`openresty`** component; Ubuntu uses the host codename and **`main`**.
|
||||||
|
So on a Debian 13 (trixie) host, point at the `bookworm` distribution (binary-
|
||||||
|
compatible, same OpenSSL 3 era).
|
||||||
|
|
||||||
```bash
|
```bash
|
||||||
# Debian: OR_PATH=package/debian Ubuntu/Mint: OR_PATH=package/ubuntu
|
|
||||||
. /etc/os-release
|
. /etc/os-release
|
||||||
case "$ID" in debian) OR_PATH=package/debian;; *) OR_PATH=package/ubuntu;; esac
|
CODENAME="$(lsb_release -sc)"
|
||||||
|
case "$ID" in
|
||||||
|
debian)
|
||||||
|
OR_PATH=package/debian
|
||||||
|
OR_COMPONENT=openresty
|
||||||
|
# Debian tree only publishes up to bookworm; fall back to it for trixie+.
|
||||||
|
case "$CODENAME" in jessie|stretch|buster|bullseye|bookworm) OR_DISTRO="$CODENAME";; *) OR_DISTRO=bookworm;; esac
|
||||||
|
;;
|
||||||
|
*)
|
||||||
|
OR_PATH=package/ubuntu
|
||||||
|
OR_DISTRO="$CODENAME"
|
||||||
|
OR_COMPONENT=main
|
||||||
|
;;
|
||||||
|
esac
|
||||||
|
|
||||||
wget -O - https://openresty.org/package/pubkey.gpg | \
|
wget -O - https://openresty.org/package/pubkey.gpg | \
|
||||||
sudo gpg --dearmor -o /usr/share/keyrings/openresty.gpg
|
sudo gpg --dearmor -o /usr/share/keyrings/openresty.gpg
|
||||||
|
|
||||||
echo "deb [arch=$(dpkg --print-architecture) signed-by=/usr/share/keyrings/openresty.gpg] http://openresty.org/${OR_PATH} $(lsb_release -sc) main" | \
|
echo "deb [arch=$(dpkg --print-architecture) signed-by=/usr/share/keyrings/openresty.gpg] http://openresty.org/${OR_PATH} ${OR_DISTRO} ${OR_COMPONENT}" | \
|
||||||
sudo tee /etc/apt/sources.list.d/openresty.list
|
sudo tee /etc/apt/sources.list.d/openresty.list
|
||||||
```
|
```
|
||||||
|
|
||||||
|
|||||||
+20
-6
@@ -48,18 +48,32 @@ echo "deb [signed-by=/etc/apt/keyrings/nodesource.gpg] https://deb.nodesource.co
|
|||||||
> /etc/apt/sources.list.d/nodesource.list
|
> /etc/apt/sources.list.d/nodesource.list
|
||||||
|
|
||||||
echo "==> OpenResty apt source"
|
echo "==> OpenResty apt source"
|
||||||
# openresty.org ships distinct trees for Debian vs Ubuntu; pick by distro ID.
|
# openresty.org ships distinct trees (and components) for Debian vs Ubuntu.
|
||||||
# (Using the ubuntu tree with a Debian codename worked on older Debian by
|
# Debian tree: component "openresty", published only up to "bookworm" (no
|
||||||
# coincidence — trixie lives under /debian, so be explicit.)
|
# trixie block) — so on a newer Debian host use the host codename when it's
|
||||||
|
# published, else fall back to bookworm (binary-compatible with trixie, same
|
||||||
|
# OpenSSL 3 era). Ubuntu tree: component "main", use the host codename.
|
||||||
. /etc/os-release 2>/dev/null || true
|
. /etc/os-release 2>/dev/null || true
|
||||||
|
CODENAME="$(lsb_release -sc 2>/dev/null || echo "")"
|
||||||
case "${ID:-}" in
|
case "${ID:-}" in
|
||||||
debian) OR_REPO_PATH="package/debian" ;;
|
debian)
|
||||||
*) OR_REPO_PATH="package/ubuntu" ;; # ubuntu, mint, etc.
|
OR_REPO_PATH="package/debian"
|
||||||
|
OR_COMPONENT="openresty"
|
||||||
|
case "$CODENAME" in
|
||||||
|
jessie|stretch|buster|bullseye|bookworm) OR_DISTRO="$CODENAME" ;;
|
||||||
|
*) OR_DISTRO="bookworm" ;;
|
||||||
|
esac
|
||||||
|
;;
|
||||||
|
*)
|
||||||
|
OR_REPO_PATH="package/ubuntu"
|
||||||
|
OR_DISTRO="$CODENAME"
|
||||||
|
OR_COMPONENT="main"
|
||||||
|
;;
|
||||||
esac
|
esac
|
||||||
install -d -m 0755 /usr/share/keyrings
|
install -d -m 0755 /usr/share/keyrings
|
||||||
wget -qO- https://openresty.org/package/pubkey.gpg \
|
wget -qO- https://openresty.org/package/pubkey.gpg \
|
||||||
| gpg --dearmor --yes -o /usr/share/keyrings/openresty.gpg
|
| gpg --dearmor --yes -o /usr/share/keyrings/openresty.gpg
|
||||||
echo "deb [arch=$(dpkg --print-architecture) signed-by=/usr/share/keyrings/openresty.gpg] http://openresty.org/${OR_REPO_PATH} $(lsb_release -sc) main" \
|
echo "deb [arch=$(dpkg --print-architecture) signed-by=/usr/share/keyrings/openresty.gpg] http://openresty.org/${OR_REPO_PATH} ${OR_DISTRO} ${OR_COMPONENT}" \
|
||||||
> /etc/apt/sources.list.d/openresty.list
|
> /etc/apt/sources.list.d/openresty.list
|
||||||
|
|
||||||
# Debian 13 (trixie) tightened apt's sequoia GPG backend to reject SHA-1
|
# Debian 13 (trixie) tightened apt's sequoia GPG backend to reject SHA-1
|
||||||
|
|||||||
Reference in New Issue
Block a user