docs: expand Linux manual installation guide#574
docs: expand Linux manual installation guide#574brian-c11 wants to merge 1 commit intotofuutils:mainfrom
Conversation
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>
utafrali
left a comment
There was a problem hiding this comment.
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.
| ```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 |
There was a problem hiding this comment.
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"| ```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 |
There was a problem hiding this comment.
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"
doneThe 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.
|
|
||
| ```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" |
There was a problem hiding this comment.
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"| Reload your shell: | ||
|
|
||
| ```sh | ||
| source ~/.profile |
There was a problem hiding this comment.
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|
Thanks! Me or @Nmishin will check it |
Summary
Fixes #263 — the Linux manual installation guide was a single vague sentence with no actionable commands.
sudo/root): extracts to/usr/local/bindirectly, with an alternative dedicated-directory + symlink approach~/bin, includesPATHsetup and shell reload instructions, notes that tenv will use~/.tenvfor managed toolscurlonly — nojqdependency (usesgrep/sedto parse the latest version)tenv_${VERSION}_Linux_x86_64.tar.gz)Linux: dkpg→Linux: dpkgin the cosign prerequisites sectionTest plan
~/binPATH export lands correctly in a new shell session🤖 Generated with Claude Code