From 85c0c26fb9eaabbc62f5f748d4c6473b95841de2 Mon Sep 17 00:00:00 2001 From: shanky Date: Mon, 6 Oct 2025 02:13:22 +0530 Subject: [PATCH 1/3] 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 --- README.md | 131 ++++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 131 insertions(+) diff --git a/README.md b/README.md index 3b1d50cf..4f493040 100644 --- a/README.md +++ b/README.md @@ -168,6 +168,41 @@ sudo dpkg -i cosign_${LATEST_VERSION}_amd64.deb +
Linux: Manual Installation Prerequisites
+ +For manual installation on Linux, you'll need the following tools: + +```sh +# Install required tools (choose based on your distribution) + +# For Debian/Ubuntu-based distributions: +sudo apt update +sudo apt install wget jq + +# For RHEL/CentOS/Fedora-based distributions: +sudo yum install wget jq +# or for newer versions: +sudo dnf install wget jq + +# For Arch Linux: +sudo pacman -S wget jq + +# For Alpine Linux: +sudo apk add wget jq +``` + +If you want to install cosign for verification (optional): + +```sh +BINDIR=${HOME}/bin +mkdir -p ${BINDIR} +wget -q -O - "https://api.github.com/repos/sigstore/cosign/releases/latest" | \ + jq -r '.assets[] | select(.name | match("cosign-linux-amd64$") ) | .browser_download_url' | \ + wget -q -i - -O ${BINDIR}/cosign && chmod 700 ${BINDIR}/cosign +``` + +
+ ### Installation @@ -321,8 +356,104 @@ nix-shell -p tenv #### Manual Installation + +
Linux Manual Installation
+ +For Linux systems, you have two main installation options: system-wide installation (requires root privileges) or user-local installation. + +##### Option 1: System-wide Installation + +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. + +```sh +# Download and install tenv system-wide +wget -q -O - "https://api.github.com/repos/tofuutils/tenv/releases/latest" | \ + jq -r '.assets[] | select(.name | match("Linux_x86_64.tar.gz$") ) | .browser_download_url' | \ + wget -q -i - -O - | sudo tar xfz - -C /usr/local/bin + +# Verify installation +tenv --version +``` + +Alternatively, you can download to any directory in your `$PATH`: + +```sh +# Download to /usr/bin (requires sudo) +wget -q -O - "https://api.github.com/repos/tofuutils/tenv/releases/latest" | \ + jq -r '.assets[] | select(.name | match("Linux_x86_64.tar.gz$") ) | .browser_download_url' | \ + wget -q -i - -O - | sudo tar xfz - -C /usr/bin +``` + +Or install to a custom directory and create symlinks: + +```sh +# Install to /usr/local/tenv and create symlinks +sudo mkdir -p /usr/local/tenv +wget -q -O - "https://api.github.com/repos/tofuutils/tenv/releases/latest" | \ + jq -r '.assets[] | select(.name | match("Linux_x86_64.tar.gz$") ) | .browser_download_url' | \ + wget -q -i - -O - | sudo tar xfz - -C /usr/local/tenv + +# Create symlinks to a directory in PATH +sudo ln -sf /usr/local/tenv/tenv /usr/local/bin/tenv +sudo ln -sf /usr/local/tenv/terraform /usr/local/bin/terraform +sudo ln -sf /usr/local/tenv/tofu /usr/local/bin/tofu +sudo ln -sf /usr/local/tenv/terragrunt /usr/local/bin/terragrunt +sudo ln -sf /usr/local/tenv/atmos /usr/local/bin/atmos +sudo ln -sf /usr/local/tenv/terramate /usr/local/bin/terramate +sudo ln -sf /usr/local/tenv/tf /usr/local/bin/tf +``` + +##### Option 2: User-local Installation + +If you cannot escalate to `root` privileges, you can install tenv in your home directory. This method installs tenv only for the current user. + +```sh +# Create a local bin directory +BINDIR=${HOME}/bin +mkdir -p ${BINDIR} + +# Download and install tenv locally +wget -q -O - "https://api.github.com/repos/tofuutils/tenv/releases/latest" | \ + jq -r '.assets[] | select(.name | match("Linux_x86_64.tar.gz$") ) | .browser_download_url' | \ + wget -q -i - -O - | tar xfz - -C ${BINDIR} + +# Add to PATH if not already done (add to ~/.profile, ~/.bashrc, or ~/.zshrc) +echo 'export PATH="$HOME/bin:$PATH"' >> ~/.profile + +# Reload your shell configuration or run: +source ~/.profile + +# Verify installation +tenv --version +``` + +For other shell configurations: + +```sh +# For bash users +echo 'export PATH="$HOME/bin:$PATH"' >> ~/.bashrc +source ~/.bashrc + +# For zsh users +echo 'export PATH="$HOME/bin:$PATH"' >> ~/.zshrc +source ~/.zshrc +``` + +##### Notes + +- 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). +- All commands above use `wget` instead of `curl` as it's more commonly available in minimal Linux installations. +- The installation uses a single pipeline which is more efficient than command concatenation. +- These commands can be easily automated for CI/CD scenarios. + +
+ +
Other Platforms
+ 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`. +
+ #### Docker Installation From 74010901c72204f8c2e6e84c4288f71bc2d8ba25 Mon Sep 17 00:00:00 2001 From: shanky Date: Tue, 7 Oct 2025 01:23:39 +0530 Subject: [PATCH 2/3] docs: address review feedback - use curl instead of wget - Renamed 'Linux: RPM' to 'Linux: CentOS/Fedora' - Renamed 'Linux: dkpg' to 'Linux: Debian/Ubuntu' - Updated prerequisites to use curl instead of wget and jq - Replaced all wget commands with curl equivalents - Updated installation notes to reflect curl usage Addresses feedback from kvendingoldo Signed-off-by: shanky --- README.md | 36 ++++++++++++++++++------------------ 1 file changed, 18 insertions(+), 18 deletions(-) diff --git a/README.md b/README.md index 4f493040..d8bc8b19 100644 --- a/README.md +++ b/README.md @@ -149,7 +149,7 @@ sudo pacman -S cosign -
Linux: RPM
+
Linux: CentOS/Fedora
```sh LATEST_VERSION=$(curl https://api.github.com/repos/sigstore/cosign/releases/latest | jq -r .tag_name | tr -d "v") @@ -158,7 +158,7 @@ sudo rpm -ivh cosign-${LATEST_VERSION}-1.x86_64.rpm ```
-
Linux: dkpg
+
Linux: Debian/Ubuntu
```sh LATEST_VERSION=$(curl https://api.github.com/repos/sigstore/cosign/releases/latest | jq -r .tag_name | tr -d "v") @@ -177,18 +177,18 @@ For manual installation on Linux, you'll need the following tools: # For Debian/Ubuntu-based distributions: sudo apt update -sudo apt install wget jq +sudo apt install curl jq # For RHEL/CentOS/Fedora-based distributions: -sudo yum install wget jq +sudo yum install curl jq # or for newer versions: -sudo dnf install wget jq +sudo dnf install curl jq # For Arch Linux: -sudo pacman -S wget jq +sudo pacman -S curl jq # For Alpine Linux: -sudo apk add wget jq +sudo apk add curl jq ``` If you want to install cosign for verification (optional): @@ -196,9 +196,9 @@ If you want to install cosign for verification (optional): ```sh BINDIR=${HOME}/bin mkdir -p ${BINDIR} -wget -q -O - "https://api.github.com/repos/sigstore/cosign/releases/latest" | \ +curl -s "https://api.github.com/repos/sigstore/cosign/releases/latest" | \ jq -r '.assets[] | select(.name | match("cosign-linux-amd64$") ) | .browser_download_url' | \ - wget -q -i - -O ${BINDIR}/cosign && chmod 700 ${BINDIR}/cosign + xargs curl -L -o ${BINDIR}/cosign && chmod 700 ${BINDIR}/cosign ```
@@ -367,9 +367,9 @@ If you can escalate to `root` privileges (with `su` or `sudo` or by logging in a ```sh # Download and install tenv system-wide -wget -q -O - "https://api.github.com/repos/tofuutils/tenv/releases/latest" | \ +curl -s "https://api.github.com/repos/tofuutils/tenv/releases/latest" | \ jq -r '.assets[] | select(.name | match("Linux_x86_64.tar.gz$") ) | .browser_download_url' | \ - wget -q -i - -O - | sudo tar xfz - -C /usr/local/bin + xargs curl -L | sudo tar xfz - -C /usr/local/bin # Verify installation tenv --version @@ -379,9 +379,9 @@ Alternatively, you can download to any directory in your `$PATH`: ```sh # Download to /usr/bin (requires sudo) -wget -q -O - "https://api.github.com/repos/tofuutils/tenv/releases/latest" | \ +curl -s "https://api.github.com/repos/tofuutils/tenv/releases/latest" | \ jq -r '.assets[] | select(.name | match("Linux_x86_64.tar.gz$") ) | .browser_download_url' | \ - wget -q -i - -O - | sudo tar xfz - -C /usr/bin + xargs curl -L | sudo tar xfz - -C /usr/bin ``` Or install to a custom directory and create symlinks: @@ -389,9 +389,9 @@ Or install to a custom directory and create symlinks: ```sh # Install to /usr/local/tenv and create symlinks sudo mkdir -p /usr/local/tenv -wget -q -O - "https://api.github.com/repos/tofuutils/tenv/releases/latest" | \ +curl -s "https://api.github.com/repos/tofuutils/tenv/releases/latest" | \ jq -r '.assets[] | select(.name | match("Linux_x86_64.tar.gz$") ) | .browser_download_url' | \ - wget -q -i - -O - | sudo tar xfz - -C /usr/local/tenv + xargs curl -L | sudo tar xfz - -C /usr/local/tenv # Create symlinks to a directory in PATH sudo ln -sf /usr/local/tenv/tenv /usr/local/bin/tenv @@ -413,9 +413,9 @@ BINDIR=${HOME}/bin mkdir -p ${BINDIR} # Download and install tenv locally -wget -q -O - "https://api.github.com/repos/tofuutils/tenv/releases/latest" | \ +curl -s "https://api.github.com/repos/tofuutils/tenv/releases/latest" | \ jq -r '.assets[] | select(.name | match("Linux_x86_64.tar.gz$") ) | .browser_download_url' | \ - wget -q -i - -O - | tar xfz - -C ${BINDIR} + xargs curl -L | tar xfz - -C ${BINDIR} # Add to PATH if not already done (add to ~/.profile, ~/.bashrc, or ~/.zshrc) echo 'export PATH="$HOME/bin:$PATH"' >> ~/.profile @@ -442,7 +442,7 @@ source ~/.zshrc ##### Notes - 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). -- All commands above use `wget` instead of `curl` as it's more commonly available in minimal Linux installations. +- All commands above use `curl` which is widely available across Linux distributions. - The installation uses a single pipeline which is more efficient than command concatenation. - These commands can be easily automated for CI/CD scenarios. From 03d5c64b32795477639011e6247bec0424138936 Mon Sep 17 00:00:00 2001 From: shanky Date: Tue, 7 Oct 2025 01:30:30 +0530 Subject: [PATCH 3/3] docs: eliminate jq dependency - use curl-only solution - Removed jq from prerequisites completely - Updated all installation commands to use direct download URLs Signed-off-by: shanky --- README.md | 30 ++++++++++-------------------- 1 file changed, 10 insertions(+), 20 deletions(-) diff --git a/README.md b/README.md index d8bc8b19..0aebfbbf 100644 --- a/README.md +++ b/README.md @@ -177,18 +177,18 @@ For manual installation on Linux, you'll need the following tools: # For Debian/Ubuntu-based distributions: sudo apt update -sudo apt install curl jq +sudo apt install curl # For RHEL/CentOS/Fedora-based distributions: -sudo yum install curl jq +sudo yum install curl # or for newer versions: -sudo dnf install curl jq +sudo dnf install curl # For Arch Linux: -sudo pacman -S curl jq +sudo pacman -S curl # For Alpine Linux: -sudo apk add curl jq +sudo apk add curl ``` If you want to install cosign for verification (optional): @@ -196,9 +196,7 @@ If you want to install cosign for verification (optional): ```sh BINDIR=${HOME}/bin mkdir -p ${BINDIR} -curl -s "https://api.github.com/repos/sigstore/cosign/releases/latest" | \ - jq -r '.assets[] | select(.name | match("cosign-linux-amd64$") ) | .browser_download_url' | \ - xargs curl -L -o ${BINDIR}/cosign && chmod 700 ${BINDIR}/cosign +curl -L "https://github.com/sigstore/cosign/releases/latest/download/cosign-linux-amd64" -o ${BINDIR}/cosign && chmod 700 ${BINDIR}/cosign ```
@@ -367,9 +365,7 @@ If you can escalate to `root` privileges (with `su` or `sudo` or by logging in a ```sh # Download and install tenv system-wide -curl -s "https://api.github.com/repos/tofuutils/tenv/releases/latest" | \ - jq -r '.assets[] | select(.name | match("Linux_x86_64.tar.gz$") ) | .browser_download_url' | \ - xargs curl -L | sudo tar xfz - -C /usr/local/bin +curl -L "https://github.com/tofuutils/tenv/releases/latest/download/tenv_Linux_x86_64.tar.gz" | sudo tar xfz - -C /usr/local/bin # Verify installation tenv --version @@ -379,9 +375,7 @@ Alternatively, you can download to any directory in your `$PATH`: ```sh # Download to /usr/bin (requires sudo) -curl -s "https://api.github.com/repos/tofuutils/tenv/releases/latest" | \ - jq -r '.assets[] | select(.name | match("Linux_x86_64.tar.gz$") ) | .browser_download_url' | \ - xargs curl -L | sudo tar xfz - -C /usr/bin +curl -L "https://github.com/tofuutils/tenv/releases/latest/download/tenv_Linux_x86_64.tar.gz" | sudo tar xfz - -C /usr/bin ``` Or install to a custom directory and create symlinks: @@ -389,9 +383,7 @@ Or install to a custom directory and create symlinks: ```sh # Install to /usr/local/tenv and create symlinks sudo mkdir -p /usr/local/tenv -curl -s "https://api.github.com/repos/tofuutils/tenv/releases/latest" | \ - jq -r '.assets[] | select(.name | match("Linux_x86_64.tar.gz$") ) | .browser_download_url' | \ - xargs curl -L | sudo tar xfz - -C /usr/local/tenv +curl -L "https://github.com/tofuutils/tenv/releases/latest/download/tenv_Linux_x86_64.tar.gz" | sudo tar xfz - -C /usr/local/tenv # Create symlinks to a directory in PATH sudo ln -sf /usr/local/tenv/tenv /usr/local/bin/tenv @@ -413,9 +405,7 @@ BINDIR=${HOME}/bin mkdir -p ${BINDIR} # Download and install tenv locally -curl -s "https://api.github.com/repos/tofuutils/tenv/releases/latest" | \ - jq -r '.assets[] | select(.name | match("Linux_x86_64.tar.gz$") ) | .browser_download_url' | \ - xargs curl -L | tar xfz - -C ${BINDIR} +curl -L "https://github.com/tofuutils/tenv/releases/latest/download/tenv_Linux_x86_64.tar.gz" | tar xfz - -C ${BINDIR} # Add to PATH if not already done (add to ~/.profile, ~/.bashrc, or ~/.zshrc) echo 'export PATH="$HOME/bin:$PATH"' >> ~/.profile