Skip to content

docs: expand Linux manual installation guide#574

Open
brian-c11 wants to merge 1 commit intotofuutils:mainfrom
brian-c11:docs/expand-linux-manual-install
Open

docs: expand Linux manual installation guide#574
brian-c11 wants to merge 1 commit intotofuutils:mainfrom
brian-c11:docs/expand-linux-manual-install

Conversation

@brian-c11
Copy link
Copy Markdown

Summary

Fixes #263 — the Linux manual installation guide was a single vague sentence with no actionable commands.

  • Adds a system-wide installation section (with sudo/root): extracts to /usr/local/bin directly, with an alternative dedicated-directory + symlink approach
  • Adds a user-local installation section (no root required): extracts to ~/bin, includes PATH setup and shell reload instructions, notes that tenv will use ~/.tenv for managed tools
  • Uses curl only — no jq dependency (uses grep/sed to parse the latest version)
  • Uses accurate asset naming from the release page (tenv_${VERSION}_Linux_x86_64.tar.gz)
  • Fixes typo: Linux: dkpgLinux: dpkg in the cosign prerequisites section

Test plan

  • Verify system-wide install commands work on a fresh Linux x86_64 box
  • Verify user-local install commands work without root
  • Confirm ~/bin PATH export lands correctly in a new shell session
  • Check other architectures (arm64, i386) by substituting the arch string

🤖 Generated with Claude Code

Add system-wide and user-local installation sections with working
curl-only commands (no jq dependency). Also fix typo dkpg -> dpkg
in the cosign prerequisites section.

Closes tofuutils#263

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Copy link
Copy Markdown
Contributor

@utafrali utafrali left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The direction is right -- going from a single vague sentence to step-by-step instructions is a clear improvement, and the typo fix is welcome. However, the shell commands have correctness problems that would affect real users: the tarball extraction pollutes /usr/local/bin and ~/bin with docs files, the symlink alternative only wires up one of seven shipped binaries, and the multi-arch guidance is contradicted by hardcoded x86_64 in the download URLs.

Comment thread README.md
```sh
LATEST_VERSION=$(curl --silent "https://api.github.com/repos/tofuutils/tenv/releases/latest" | grep '"tag_name"' | sed 's/.*"tag_name": *"\([^"]*\)".*/\1/')
curl -O -L "https://github.com/tofuutils/tenv/releases/latest/download/tenv_${LATEST_VERSION}_Linux_x86_64.tar.gz"
sudo tar xzf "tenv_${LATEST_VERSION}_Linux_x86_64.tar.gz" -C /usr/local/bin
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The tenv release tarball contains non-binary files alongside the executables: CHANGELOG.md, LICENSE, and README.md. Running sudo tar xzf ... -C /usr/local/bin extracts all of them directly into /usr/local/bin, which is incorrect.

Extract to a staging directory first, then copy only the binaries:

TMP=$(mktemp -d)
sudo tar xzf "tenv_${LATEST_VERSION}_Linux_x86_64.tar.gz" -C "$TMP"
sudo cp "$TMP"/tenv "$TMP"/tofu "$TMP"/terraform "$TMP"/terragrunt "$TMP"/terramate "$TMP"/tf "$TMP"/atmos /usr/local/bin/
rm -rf "$TMP"

Comment thread README.md
```sh
sudo mkdir -p /usr/local/tenv
sudo tar xzf "tenv_${LATEST_VERSION}_Linux_x86_64.tar.gz" -C /usr/local/tenv
sudo ln -sf /usr/local/tenv/tenv /usr/local/bin/tenv
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The tarball ships seven binaries: tenv, tofu, terraform, terragrunt, terramate, tf, and atmos. Creating a symlink only for tenv leaves the other six inaccessible, making this alternative approach functionally incomplete compared to the direct-to-bin option above.

Create symlinks for all binaries:

for bin in tenv tofu terraform terragrunt terramate tf atmos; do
  sudo ln -sf "/usr/local/tenv/$bin" "/usr/local/bin/$bin"
done

The same gap applies to the user-local section at line 358: tar xzf ... -C ~/bin will also deposit CHANGELOG.md, LICENSE, and README.md into ~/bin.

Comment thread README.md

```sh
LATEST_VERSION=$(curl --silent "https://api.github.com/repos/tofuutils/tenv/releases/latest" | grep '"tag_name"' | sed 's/.*"tag_name": *"\([^"]*\)".*/\1/')
curl -O -L "https://github.com/tofuutils/tenv/releases/latest/download/tenv_${LATEST_VERSION}_Linux_x86_64.tar.gz"
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The prose at line 330 tells users to "Determine your architecture (x86_64, arm64, armv6, or i386) and run:", but both code blocks (here and at line 356) still hardcode x86_64. A user on arm64 who follows the instruction would run a command that downloads the wrong binary with no indication of where to substitute.

Introduce an ARCH variable at the top of each code block:

ARCH=x86_64  # change to arm64, armv6, or i386 if needed
LATEST_VERSION=$(curl --silent "https://api.github.com/repos/tofuutils/tenv/releases/latest" | grep '"tag_name"' | sed 's/.*"tag_name": *"\([^"]*\)".*/\1/')
curl -O -L "https://github.com/tofuutils/tenv/releases/latest/download/tenv_${LATEST_VERSION}_Linux_${ARCH}.tar.gz"

Comment thread README.md
Reload your shell:

```sh
source ~/.profile
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The reload command hardcodes source ~/.profile, but the preceding prose tells users to add the export to ~/.profile (or ~/.bashrc). A user who followed the parenthetical and edited ~/.bashrc would run source ~/.profile and see no effect.

On most modern Linux distros, ~/.bashrc is the right target for interactive shell configuration. Either change the source command to match whichever file was edited, or standardize on ~/.bashrc throughout:

source ~/.bashrc

@kvendingoldo
Copy link
Copy Markdown
Collaborator

Thanks! Me or @Nmishin will check it

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.

Linux manual installation guide is largely incomplete

4 participants