Skip to content

Commit 85c0c26

Browse files
committed
docs: improve Linux manual installation guide
- Added comprehensive Linux manual installation instructions - Included both system-wide and user-local installation options - Added prerequisites section for Linux manual installation - Improved commands based on community suggestions in issue #263 - Used wget instead of curl for better compatibility - Added clear examples for different installation scenarios Fixes #263 Signed-off-by: shanky <sankalpt92@gmail.com>
1 parent c8adcbe commit 85c0c26

1 file changed

Lines changed: 131 additions & 0 deletions

File tree

README.md

Lines changed: 131 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -168,6 +168,41 @@ sudo dpkg -i cosign_${LATEST_VERSION}_amd64.deb
168168

169169
</details>
170170

171+
<details markdown="1"><summary><b>Linux: Manual Installation Prerequisites</b></summary><br>
172+
173+
For manual installation on Linux, you'll need the following tools:
174+
175+
```sh
176+
# Install required tools (choose based on your distribution)
177+
178+
# For Debian/Ubuntu-based distributions:
179+
sudo apt update
180+
sudo apt install wget jq
181+
182+
# For RHEL/CentOS/Fedora-based distributions:
183+
sudo yum install wget jq
184+
# or for newer versions:
185+
sudo dnf install wget jq
186+
187+
# For Arch Linux:
188+
sudo pacman -S wget jq
189+
190+
# For Alpine Linux:
191+
sudo apk add wget jq
192+
```
193+
194+
If you want to install cosign for verification (optional):
195+
196+
```sh
197+
BINDIR=${HOME}/bin
198+
mkdir -p ${BINDIR}
199+
wget -q -O - "https://api.github.com/repos/sigstore/cosign/releases/latest" | \
200+
jq -r '.assets[] | select(.name | match("cosign-linux-amd64$") ) | .browser_download_url' | \
201+
wget -q -i - -O ${BINDIR}/cosign && chmod 700 ${BINDIR}/cosign
202+
```
203+
204+
</details>
205+
171206

172207
<a id="installation"></a>
173208
### Installation
@@ -321,8 +356,104 @@ nix-shell -p tenv
321356

322357
<a id="manual-installation"></a>
323358
#### Manual Installation
359+
360+
<details markdown="1"><summary><b>Linux Manual Installation</b></summary><br>
361+
362+
For Linux systems, you have two main installation options: system-wide installation (requires root privileges) or user-local installation.
363+
364+
##### Option 1: System-wide Installation
365+
366+
If you can escalate to `root` privileges (with `su` or `sudo` or by logging in as `root`), you can make a system-wide installation of the `tenv` tool.
367+
368+
```sh
369+
# Download and install tenv system-wide
370+
wget -q -O - "https://api.github.com/repos/tofuutils/tenv/releases/latest" | \
371+
jq -r '.assets[] | select(.name | match("Linux_x86_64.tar.gz$") ) | .browser_download_url' | \
372+
wget -q -i - -O - | sudo tar xfz - -C /usr/local/bin
373+
374+
# Verify installation
375+
tenv --version
376+
```
377+
378+
Alternatively, you can download to any directory in your `$PATH`:
379+
380+
```sh
381+
# Download to /usr/bin (requires sudo)
382+
wget -q -O - "https://api.github.com/repos/tofuutils/tenv/releases/latest" | \
383+
jq -r '.assets[] | select(.name | match("Linux_x86_64.tar.gz$") ) | .browser_download_url' | \
384+
wget -q -i - -O - | sudo tar xfz - -C /usr/bin
385+
```
386+
387+
Or install to a custom directory and create symlinks:
388+
389+
```sh
390+
# Install to /usr/local/tenv and create symlinks
391+
sudo mkdir -p /usr/local/tenv
392+
wget -q -O - "https://api.github.com/repos/tofuutils/tenv/releases/latest" | \
393+
jq -r '.assets[] | select(.name | match("Linux_x86_64.tar.gz$") ) | .browser_download_url' | \
394+
wget -q -i - -O - | sudo tar xfz - -C /usr/local/tenv
395+
396+
# Create symlinks to a directory in PATH
397+
sudo ln -sf /usr/local/tenv/tenv /usr/local/bin/tenv
398+
sudo ln -sf /usr/local/tenv/terraform /usr/local/bin/terraform
399+
sudo ln -sf /usr/local/tenv/tofu /usr/local/bin/tofu
400+
sudo ln -sf /usr/local/tenv/terragrunt /usr/local/bin/terragrunt
401+
sudo ln -sf /usr/local/tenv/atmos /usr/local/bin/atmos
402+
sudo ln -sf /usr/local/tenv/terramate /usr/local/bin/terramate
403+
sudo ln -sf /usr/local/tenv/tf /usr/local/bin/tf
404+
```
405+
406+
##### Option 2: User-local Installation
407+
408+
If you cannot escalate to `root` privileges, you can install tenv in your home directory. This method installs tenv only for the current user.
409+
410+
```sh
411+
# Create a local bin directory
412+
BINDIR=${HOME}/bin
413+
mkdir -p ${BINDIR}
414+
415+
# Download and install tenv locally
416+
wget -q -O - "https://api.github.com/repos/tofuutils/tenv/releases/latest" | \
417+
jq -r '.assets[] | select(.name | match("Linux_x86_64.tar.gz$") ) | .browser_download_url' | \
418+
wget -q -i - -O - | tar xfz - -C ${BINDIR}
419+
420+
# Add to PATH if not already done (add to ~/.profile, ~/.bashrc, or ~/.zshrc)
421+
echo 'export PATH="$HOME/bin:$PATH"' >> ~/.profile
422+
423+
# Reload your shell configuration or run:
424+
source ~/.profile
425+
426+
# Verify installation
427+
tenv --version
428+
```
429+
430+
For other shell configurations:
431+
432+
```sh
433+
# For bash users
434+
echo 'export PATH="$HOME/bin:$PATH"' >> ~/.bashrc
435+
source ~/.bashrc
436+
437+
# For zsh users
438+
echo 'export PATH="$HOME/bin:$PATH"' >> ~/.zshrc
439+
source ~/.zshrc
440+
```
441+
442+
##### Notes
443+
444+
- Any subsequent call to `tenv` will refer to the calling user's `$HOME` directory, thus installing, running and listing whatever binaries are present in the local directory (`~/.tenv` by default).
445+
- All commands above use `wget` instead of `curl` as it's more commonly available in minimal Linux installations.
446+
- The installation uses a single pipeline which is more efficient than command concatenation.
447+
- These commands can be easily automated for CI/CD scenarios.
448+
449+
</details>
450+
451+
<details markdown="1"><summary><b>Other Platforms</b></summary><br>
452+
324453
Get the most recent packaged binaries (`.deb`, `.rpm`, `.apk`, `pkg.tar.zst `, `.zip` or `.tar.gz` format) by visiting the [release page](https://github.com/tofuutils/tenv/releases). After downloading, unzip the folder and seamlessly integrate it into your system's `PATH`.
325454

455+
</details>
456+
326457
<a id="docker-installation"></a>
327458

328459
#### Docker Installation

0 commit comments

Comments
 (0)