Hacktoberfest 2026: the issues maintainers tagged for October, open and beginner-friendly. Browse Hacktoberfest issues

install.sh fails due to overwriting variable

Open Beginner friendly
#49,337 0 comments 0 reactions 0 assignees View on GitHub

Maintainers usually reply within 1 day

Nobody has claimed this yet.

Assessment

Difficulty
1/5
Estimated time
Under an hour
Newbie friendliness
88/100
Issue type
Bug
Clarity
Clearly specified
Activity status
Active
Tech stack
shell
Domain
cli

Research direction

Start with install.sh and inspect verify_archive_digest, especially how archive_path is assigned and later used. Run curl -fsSL https://chatgpt.com/codex/install.sh | sh on macOS or Linux; done means the installer no longer reports a checksum mismatch caused by variable overwriting.

Written by the indexing model from the issue text.

Description

bug CLI
What version of Codex CLI is running?

codex-cli 0.159.0

What subscription do you have?

Plus

Which model were you using?

No response

What platform is your computer?

Darwin 23.6.0 x86_64 i386

What terminal emulator and version are you using (if applicable)?

Ghostty 1.3.1

Codex doctor report

What issue are you seeing?

Description

The Getting Started section of the Codex CLI documentation recommends the following command for installing on macOS/Linux:

curl -fsSL https://chatgpt.com/codex/install.sh | sh

However, this script (install.sh) has several issues. In particular, it overwrites global variables inside functions, which can cause problems.

In my environment, the following function overwrites the global variable $archive_path, which causes the problem:

verify_archive_digest() {
  archive_path="$1"
  expected_digest="$2"
  actual_digest="$(file_sha256 "$archive_path")"

  if [ "$actual_digest" != "$expected_digest" ]; then
    echo "Downloaded Codex archive checksum did not match expected digest." >&2
    echo "expected: $expected_digest" >&2
    echo "actual:   $actual_digest" >&2
    return 1
  fi
}

As a result, the following error occurred:

% https://learn.chatgpt.com/docs/codex/cli#getting-started
==> Installing Codex CLI
==> Detected platform: macOS (Intel)
==> Resolved version: 0.159.0
==> Downloading Codex CLI
Downloaded Codex archive checksum did not match expected digest.
expected: ab64d30288454124c7c15abd81672a9dfda7e3e723d76c4cfa6c0aba4b439017
actual:   730788ed8c1b65844546e2a34816284275b7833beb3f21eec07e38ee5497f272
WARNING: Could not download or verify https://releases.openai.com/codex/releases/0.159.0/codex-package-x86_64-apple-darwin.tar.gz; retrying from GitHub Releases.
Downloaded Codex archive checksum did not match expected digest.
expected: ab64d30288454124c7c15abd81672a9dfda7e3e723d76c4cfa6c0aba4b439017
actual:   730788ed8c1b65844546e2a34816284275b7833beb3f21eec07e38ee5497f272
Downloaded Codex archive checksum did not match expected digest.
expected: ab64d30288454124c7c15abd81672a9dfda7e3e723d76c4cfa6c0aba4b439017
actual:   730788ed8c1b65844546e2a34816284275b7833beb3f21eec07e38ee5497f272

Workaround

I applied the following ad hoc fix:

--- codex_install_orig.sh	2026-09-30 01:54:28
+++ codex_install.sh	2026-09-30 01:52:32
@@ -553,9 +553,9 @@
 }
 
 verify_archive_digest() {
-  archive_path="$1"
+  archive_path_local="$1"
   expected_digest="$2"
-  actual_digest="$(file_sha256 "$archive_path")"
+  actual_digest="$(file_sha256 "$archive_path_local")"
 
   if [ "$actual_digest" != "$expected_digest" ]; then
     echo "Downloaded Codex archive checksum did not match expected digest." >&2
What steps can reproduce the bug?

Just do curl -fsSL https://chatgpt.com/codex/install.sh | sh

What is the expected behavior?

No response

Additional information

No response

Dominant language
Rust
Stars
127k
Forks
19.9k
Avg merge
1m
Merged PRs (30d)
996

Getting set up

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from openai/codex

All issues in openai/codex

Similar issues

More Rust issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.