Skip to content

Restructure the packages quick start: fix ARM commands, add offline install, cut 42% - #158

Closed
guanzhousongmicrosoft wants to merge 4 commits into
mainfrom
users/guanzhousong/packages-arch-callouts
Closed

Restructure the packages quick start: fix ARM commands, add offline install, cut 42%#158
guanzhousongmicrosoft wants to merge 4 commits into
mainfrom
users/guanzhousong/packages-arch-callouts

Conversation

@guanzhousongmicrosoft

@guanzhousongmicrosoft guanzhousongmicrosoft commented Aug 25, 2026

Copy link
Copy Markdown
Contributor

Fixes an architecture bug in the install commands, adds offline guidance, and restructures the page around the install command after a clarity review.


1. ARM hosts get confusing errors

The Package Finder is architecture-aware and the command builders interpolate the selected architecture correctly — tests already cover amd64/arm64 and x86_64/aarch64. The static prose beneath them is rendered once with amd64/x86_64 and carried no arch-swap note, so a reader on an ARM host copies the example and hits an error that never mentions architecture:

  • APTarch=amd64 lets apt update succeed, then the install fails with documentdb-18 : Depends: postgresql-18-documentdb but it is not installable. The meta and stand-alone packages are Architecture: all and resolve either way, so only the extension package goes missing — which hides the cause.
  • RPMEL-9-x86_64 installs the wrong PGDG reporpm. The file name pgdg-redhat-repo-latest.noarch.rpm is identical for both architectures, so it installs silently, writes x86_64 URLs and keys, and the next dnf call fails with Bad GPG signature on pgdg-common while epel, crb and documentdb all verify normally.

Fixed with one substitution table listing the three strings that change, with the arch-agnostic forms (arch=$(dpkg --print-architecture), EL-9-$(uname -m)) as the primary advice — which is what PACKAGE-INSTALL.md in this repo already used. The published article had drifted from it.

The builders are deliberately untouched: dropping arch= would orphan aptArch and make the Package Finder's architecture selector meaningless.

2. Offline / air-gapped install

An air-gapped host has no route to PGDG either, and DocumentDB depends on PostgreSQL, pg_cron, pgvector and PostGIS — so downloading the release assets is not enough, and the page had nothing for that case.

Added a section covering one file, several files, and one command. Staging the dependency closure and indexing it (dpkg-scanpackages / createrepo_c) gives the target a real repository index, so the air-gapped install stays a single apt install documentdb-18 with full dependency resolution.

It also documents the trap that makes a bundle look complete and fail on arrival: apt-get install --download-only and a bare dnf download --resolve skip anything already installed on the staging machine. That is a reproduced failure, not a hypothetical — the first attempt staged 133 packages instead of 205 and died with:

postgresql-common : Depends: adduser but it is not installable
                    Depends: perl:any but it is not installable
E: Unable to correct problems, you have held broken packages.

3. Restructure after a clarity review

A review measured the page at 3,519 words with the first copyable command 617 words down, behind a package inventory, a version-tier table and a support matrix — a reference manual, not a quick start. It also found 544 words of blockquote (20% of all prose) and, notably, that the page used none of the GitHub-style alert markers the renderer supports, so all eight callouts rendered as the same blue box and the load-bearing crb warning was visually indistinguishable from Debian 13 trivia.

  • Lead with the two install commands; move everything consulted-not-followed into one Other targets section.
  • Delete Turn an extension-only install into a local mongosh endpoint (539 words) — a Rust-toolchain build guide (rustup, libssl-dev, su - postgres, a five-line $TERM comment) inside a packages quick start, repeating both the Docker command owned by the Docker Quick Start and the mongosh pointer given three times. One sentence survives, keeping the TERM=xterm trap.
  • Troubleshooting: 13 bullets → 7, keyed by the error string a reader arrives with. Most of the old list restated earlier callouts verbatim.
  • Tag callouts [!NOTE] / [!WARNING] / [!IMPORTANT] by severity.
  • Put the mongosh flags form before the URI form, since it has no percent-encoding hazard.

Result

Before After
Rendered words 3,519 2,034 (−42%)
Words before first command 617 57
## sections 14 9

Verification

Every offline command was run verbatim as written, staging on a connected container and installing into one started with --network none (each target confirmed no DNS - host is offline first, with all repository sources removed):

Path Closure Result
DEB — stage ubuntu:24.04 → offline ubuntu:24.04 205 pkgs / 203 MB apt install documentdb-18exit 0
RPM — stage rockylinux:9 → offline rockylinux:9 271 pkgs / 172 MB dnf install documentdb-18exit 0
Single file — offline host with PGDG present 1 file apt install ./…debexit 0

Repository facts checked against live endpoints: Architectures: amd64 arm64 in the Release file, both binary-*/Packages indices genuinely distinct, and EL-9-aarch64/pgdg-redhat-repo-latest.noarch.rpm → 200.

Anchors re-verified after the rename — every in-page link resolves against kebabCase(), and ## Offline / air-gapped install is deliberately unchanged so the v0.116-0 release notes keep linking to #offline-air-gapped-install. Note that slug is a single hyphen; GitHub's own slugifier produces a double, so the two are not interchangeable.

npm test 130 passed · eslint clean · tsc --noEmit clean · Next.js build green.

No shell command was altered — every flag in the generated install commands and the staging blocks is byte-identical.

Related

The Package Finder is architecture-aware and buildAptInstallCommand /
buildRpmInstallCommand interpolate the selected architecture correctly --
tests already assert that for amd64/arm64 and x86_64/aarch64. The static
prose beneath them, however, is rendered once with 'amd64' and 'x86_64'
and carried no arch-swap note, even though the same article already tells
readers to swap amd64 -> arm64 for release assets. Readers on ARM hosts
copy the example and hit an error that never mentions architecture.

Add a callout under each example:

  * APT -- arch=amd64 on an arm64 host lets `apt update` succeed and then
    fails with "documentdb-18 : Depends: postgresql-18-documentdb but it
    is not installable". The meta and stand-alone packages are
    Architecture: all and resolve either way, so only the extension
    package goes missing, which hides the real cause.
  * RPM -- EL-9-x86_64 on an aarch64 host installs the wrong PGDG
    reporpm. The file name pgdg-redhat-repo-latest.noarch.rpm is
    identical for both architectures, so it installs without complaint,
    writes x86_64 repository URLs and keys, and the next dnf call fails
    with "Bad GPG signature" on pgdg-common while epel, crb and
    documentdb all verify normally.

Each callout also gives the arch-agnostic form -- arch=$(dpkg
--print-architecture) and EL-9-$(uname -m) -- which is what
PACKAGE-INSTALL.md in this repository already uses.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Copilot-Session: f18515db-c52f-4197-aa50-d81359c7c763
Signed-off-by: Guanzhou Song <guanzhou.song@gmail.com>
GuanzhouSong and others added 3 commits August 25, 2026 11:49
A host with no route to the DocumentDB repository also has no route to
PGDG, and the extension depends on PostgreSQL itself plus pg_cron,
pgvector and PostGIS, which are PGDG packages. Downloading the release
assets alone is therefore not enough, and the guide had nothing to say
about that case.

Document staging the full dependency closure on a connected machine and
serving it to the target as a local repository, for both DEB and RPM.
Because the target then has a real repository index, the air-gapped
install stays a single `apt install documentdb-18` / `dnf install
documentdb-18` with full dependency resolution rather than an ordered
list of files. Smaller cases are covered too: the extension alone from
one file, and the full stack from the six release assets.

Call out the trap that makes a bundle look complete and fail on arrival:
`apt-get install --download-only` and a bare `dnf download --resolve`
skip anything already installed on the staging machine, so a clean target
dies with errors like "Depends: adduser but it is not installable". Use
`apt-cache depends --recurse` and `dnf download --alldeps`, which ignore
local install state.

Verified on v0.116-0 with every command run verbatim, staging on a
connected container and installing into one started with --network none:

  * DEB: closure 205 packages / 203 MB staged on ubuntu:24.04, then
    `apt install documentdb-18` on an offline ubuntu:24.04 -> exit 0.
  * RPM: closure 271 packages / 172 MB staged on rockylinux:9, then
    `dnf install documentdb-18` on an offline rockylinux:9 -> exit 0.
  * Single file: `apt install ./postgresql-18-documentdb_0.116-0_amd64.deb`
    on an offline host with the PGDG prerequisites present -> exit 0.

The first attempt used --download-only and produced exactly the failure
now documented (133 packages staged instead of 205), which is why it is
called out rather than left as a footnote.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Copilot-Session: f18515db-c52f-4197-aa50-d81359c7c763
Signed-off-by: Guanzhou Song <guanzhou.song@gmail.com>
A documentation review measured 544 words of blockquote on this page --
20% of all prose -- and singled out the two architecture callouts added
earlier as the worst offenders at 204 words between them.

Replace both with a single substitution table: three rows for the three
strings that actually change on ARM, with the arch-agnostic forms as the
primary advice so most readers need no decision at all. Both searchable
error strings survive, so anyone who hits the symptom and googles it still
lands here.

The page also used none of the GitHub-style alert markers the renderer
supports (app/components/Markdown.tsx handles [!NOTE], [!WARNING],
[!IMPORTANT], [!TIP] and [!CAUTION] with distinct colours), so all eight
callouts rendered as the same blue box and the load-bearing crb warning
was visually indistinguishable from Debian 13 trivia. Tag the ARM callout
[!WARNING], crb [!IMPORTANT] and the offline staging note [!NOTE].

Also cut the offline prose: merge the two-paragraph opener, drop the
harmless-warnings trivia to a clause, and delete the defensive "that is
not a defect in the packages" sentence, which changes nothing a reader
types.

3,519 -> 3,239 rendered words. No shell command was altered -- every flag
in the staging and install blocks is byte-identical, since those were
verified by installing into containers with the network disabled.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Copilot-Session: f18515db-c52f-4197-aa50-d81359c7c763
Signed-off-by: Guanzhou Song <guanzhou.song@gmail.com>
A clarity review found the page worked as a reference manual and failed as
a quick start: the first copyable command sat 617 words down, behind a
package inventory, a version-tier table and a support matrix that nobody
needs before installing.

Lead with the two install commands. Everything a reader consults rather
than follows -- the package roles, which version each target serves, the
per-distribution component table, the extension-only rules and the Debian
11/13 caveats -- merges into one "Other targets" section below the
operational content. The five callouts that used to precede the command
become one [!NOTE] beside it.

Delete "Turn an extension-only install into a local mongosh endpoint"
(539 words). It is a Rust-toolchain build guide -- rustup, libssl-dev,
su - postgres, a five-line comment about $TERM -- living inside a packages
quick start, and it repeated both the Docker command owned by the Docker
Quick Start and the mongosh install pointer given three separate times on
the page. What survives is one sentence in "Other targets" pointing at the
two scripts, keeping the TERM=xterm trap.

Rewrite troubleshooting from 13 bullets to 7, keyed by the error string a
reader actually arrives with instead of by category. Most of the old list
restated callouts verbatim from earlier in the page.

Put the mongosh flags form before the URI form, since it has no
percent-encoding hazard to warn about.

3,519 -> 2,034 rendered words; first copyable command at word 57. Section
count 14 -> 9. Every anchor still resolves, and the "Offline / air-gapped
install" heading is unchanged so the v0.116-0 release notes keep linking
to it. No shell command was altered.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Copilot-Session: f18515db-c52f-4197-aa50-d81359c7c763
Signed-off-by: Guanzhou Song <guanzhou.song@gmail.com>
@guanzhousongmicrosoft guanzhousongmicrosoft changed the title Note the arm64 substitutions in the package quick-start examples Restructure the packages quick start: fix ARM commands, add offline install, cut 42% Aug 25, 2026
@GuanzhouSong

Copy link
Copy Markdown
Contributor

Superseded by #159, which is the same change opened from my personal account. Closing this one.

@guanzhousongmicrosoft

Copy link
Copy Markdown
Contributor Author

Superseded by #159 — same change, opened from my personal account. Closing this one.

@guanzhousongmicrosoft
guanzhousongmicrosoft deleted the users/guanzhousong/packages-arch-callouts branch August 25, 2026 16:27
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants