Installer fails when /usr/bin/awk is mawk: digest check uses a {64} interval regex

Resolved 💬 2 comments Opened Jun 6, 2026 by JairoTorregrosa Closed Jun 6, 2026

Codex version: 0.137.0, though this is really a bug in the installer script so the version doesn't matter much.

Platform: Linux aarch64, Ubuntu 22.04 (Linux 5.15.185-tegra aarch64 aarch64). Not architecture specific, see the repro.

Terminal: zsh, xterm-256color.

What's happening

The official installer dies at the download step:

==> Downloading Codex CLI
Could not find SHA-256 digest for codex-package-aarch64-unknown-linux-musl.tar.gz in codex-package_SHA256SUMS.

Same thing happens on codex self-update, since that just runs sh -c 'curl -fsSL https://chatgpt.com/codex/install.sh | sh'. So an affected machine can't install or update.

The message points the wrong way. The SHA256SUMS asset downloads fine and the line for that tarball is right there in it (I checked the file's own digest against the release metadata too). The problem is the lookup in the installer.

It's in scripts/install/install.sh, package_archive_digest:

digest="$(awk -v asset="$asset" '
  $2 == asset && $1 ~ /^[0-9a-fA-F]{64}$/ {
    print tolower($1)
    ...

That {64} is an interval expression. On Debian and Ubuntu the default /usr/bin/awk is mawk, and mawk keeps interval expressions off unless you pass -W interval. So the regex never matches a real 64 char hash, package_archive_digest comes back empty, and the install bails out even though the checksum file was fine all along. Switching the box's awk to gawk is what fixed it and pointed me at the cause.

Repro

On anything where awk is mawk (stock Ubuntu and Debian):

$ readlink -f "$(command -v awk)"
/usr/bin/mawk

$ line='8756c80ad058199676d058bbd919812466d796886e7574a57c4e007f766e707c  codex-package-aarch64-unknown-linux-musl.tar.gz'
$ printf '%s\n' "$line" | mawk '$1 ~ /^[0-9a-fA-F]{64}$/ {print "match"}'   # prints nothing
$ printf '%s\n' "$line" | gawk '$1 ~ /^[0-9a-fA-F]{64}$/ {print "match"}'   # prints match

Then curl -fsSL https://chatgpt.com/codex/install.sh | sh fails with the message above.

Expected

Install works whatever the system awk is (mawk, gawk, busybox awk, BSD awk).

Possible fix

Drop the interval expression and check the length directly:

$2 == asset && length($1) == 64 && $1 ~ /^[0-9a-fA-F]+$/ {

Works on mawk and gawk here, and still rejects anything whose first field isn't a 64 char hex string. That {64} looks like the only interval expression in a regex in the whole script (the ????... patterns in the case blocks are shell globs, those are fine).

Workaround

If you're stuck right now:

sudo apt install gawk
sudo update-alternatives --set awk /usr/bin/gawk

then rerun the installer.

View original on GitHub ↗

This issue has 2 comments on GitHub. Read the full discussion on GitHub ↗