continue icon indicating copy to clipboard operation
continue copied to clipboard

install in wsl script

Open koosdoos88 opened this issue 10 months ago • 3 comments

Issue Category

Undocumented feature or missing documentation

Affected Documentation Page URL

No response

Issue Description

 ✅  What you really need to do Enable the Ubuntu “universe” repository (many missing packages belong there). Install the language runtimes you’ll use – Rust, Go, Node / npm, Python + pipx. Install the packages that are in the Ubuntu repos (single apt command). Install the Snap‑only tools (if you want them). Install the rest with the appropriate language‑specific installer (cargo, go, npm, pipx). Add the binary directories to $PATH once, then you’re done. Below is a complete, copy‑paste‑ready script that does exactly that on an Ubuntu 22.04 (or newer) WSL distribution. If you prefer doing each step manually, the script is fully commented so you can copy only the sections you need.

📦 Full installation script for Ubuntu WSL #!/usr/bin/env bash

=============================================================================

install_all.sh – One‑shot installer for the gigantic toolbox you posted.

Run on a fresh Ubuntu (or Ubuntu‑based) WSL distribution.

=============================================================================

set -euo pipefail IFS=$'\n\t'

------------------------------- 0️⃣ PRE‑CHECKS -------------------------------

Make sure we have sudo rights

if ! sudo -v; then echo "❌ sudo is required – aborting." exit 1 fi

------------------------------- 1️⃣ ENABLE REPOS -------------------------------

log() { echo -e "\e[32m[+] $\e[0m"; } warn(){ echo -e "\e[33m[!] $\e[0m"; }

log "Enabling the Ubuntu 'universe' repository (many packages live there)…" sudo add-apt-repository -y universe

Azure CLI, Helm, etc. need extra PPAs – we’ll add them later

sudo apt-get update -y

------------------------------- 2️⃣ CORE DEV TOOLS -------------------------------

log "Installing generic build tools, curl, git, locales…" sudo apt-get install -y
build-essential curl wget git ca-certificates gnupg2 lsb-release
software-properties-common
locales

Make sure your locale is set (WSL sometimes defaults to C.UTF-8)

sudo locale-gen en_US.UTF-8 export LANG=en_US.UTF-8

------------------------------- 3️⃣ LANGUAGE RUNTIMES -------------------------------

------- Rust (cargo) -------------------------------------------------

if ! command -v cargo >/dev/null; then log "Installing Rust via rustup…" curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh -s -- -y source "$HOME/.cargo/env" else log "Rust already installed (cargo version: $(cargo --version))" fi

------- Go -------------------------------------------------------------

if ! command -v go >/dev/null; then log "Installing Go (apt provides a recent enough version)…" sudo apt-get install -y golang else log "Go already present (go version: $(go version))" fi

------- Node.js + npm (use Node 20 LTS) ---------------------------------

if ! command -v node >/dev/null; then log "Adding NodeSource repo for Node 20 LTS…" curl -fsSL https://deb.nodesource.com/setup_20.x | sudo -E bash - sudo apt-get install -y nodejs else log "Node already installed (node –v: $(node -v))" fi

------- Python 3 + pipx -----------------------------------------------

if ! command -v pip3 >/dev/null; then log "Installing Python3 + pip…" sudo apt-get install -y python3 python3-pip python3-venv fi if ! command -v pipx >/dev/null; then log "Installing pipx (isolated Python‑CLI installer)…" python3 -m pip install --user pipx python3 -m pipx ensurepath else log "pipx already present (pipx version: $(pipx --version))" fi

Ensure the newly‑created binary dirs are in PATH for the remainder of this script

export PATH="$HOME/.cargo/bin:$HOME/go/bin:$HOME/.local/bin:$PATH"

------------------------------- 4️⃣ APT PACKAGES (available in Ubuntu) -------------------------------

log "Installing the subset of tools that exist in the official Ubuntu repos…"

APT_PKGS=(

System / monitoring

fd-find # installed as fd ripgrep fzf bat exa # Ubuntu calls it exa; we’ll alias later eza # newer replacement (already installed as eza) ncdu htop iotop sysstat duf dust duf lsof smartmontools # provides smartctl

Filesystem / search

fd-find # already listed, keeps it safe locate # mlocate gnupg2 ssh rsync

Compression / archiving

p7zip-full unzip zip zstd

Media tools

ffmpeg imagemagick # magick command

Development / git helpers

git tig jq yq

Container / k8s helper binaries that are in Ubuntu

kubectl

Misc

curl wget tree zip unzip

Snap (see next section) – we just install the snap package manager itself

snapd )

sudo apt-get install -y "${APT_PKGS[@]}"

Cleanup duplicate names (fd-find provides fd) – add an alias:

if ! command -v fd >/dev/null; then sudo ln -s "$(command -v fdfind)" /usr/local/bin/fd fi

------------------------------- 5️⃣ SNAP PACKAGES (newer binaries) -------------------------------

log "Installing a handful of tools that are only shipped as Snap packages…"

Make sure snapd is running (WSL can use snap without GUI)

sudo systemctl enable --now snapd.socket || true # ignore error on WSL (systemd may not be active)

SNAP_PKGS=( starship # modern prompt, also available via apt but snap gives newest eza # fast ls replacement (if you want the real eza binary) k9s # Kubernetes UI bat # (the snap version is usually newer than apt) bottom # (if you prefer a Snap of bottom; otherwise we’ll use cargo) )

for pkg in "${SNAP_PKGS[@]}"; do if ! snap list "$pkg" >/dev/null 2>&1; then log "Snap‑installing $pkg…" sudo snap install "$pkg" --classic || warn "snap install $pkg failed" else log "Snap $pkg already installed" fi done

------------------------------- 6️⃣ RUST CRATES (cargo install) -------------------------------

log "Installing the Rust‑based tools that are NOT in apt…"

CARGO_PKGS=( procs gotop bottom # (we also installed via snap – cargo will overwrite with latest) zenith fkill-cli joker starship # already via snap (skip if you prefer snap) ripgrep # already via apt (skip if you want newest) fd-find duf dust bat # we already have snap/bat; install latest via cargo hyperfine aichat catai chatblade gpt-engineer gptscript gptui how2

AI/LLM helpers that ship as Rust crates

(if any of them are missing from crates.io, we’ll fall back later)

)

for crate in "${CARGO_PKGS[@]}"; do bin_name="$crate"

Some crates have a different binary name

case "$crate" in fd-find) bin_name="fd" ;; bat) bin_name="batcat" ;; # Ubuntu's bat binary is batcat esac

if command -v "$bin_name" >/dev/null; then log "✔ $bin_name already in PATH – skipping cargo install." continue fi

log "cargo installing $crate…" cargo install "$crate" || warn "cargo install $crate failed" done

------------------------------- 7️⃣ GO TOOLS (go install) -------------------------------

log "Installing Go‑based utilities (via go install) …"

GO_PKGS=(

format: binary=module@version

"croc=github.com/schollz/croc/v9@latest" "gdu=github.com/dundee/gdu@latest" "lazydocker=github.com/jesseduffield/lazydocker@latest" "dive=github.com/wagoodman/dive@latest" "ghz=github.com/bojand/ghz@latest" )

for entry in "${GO_PKGS[@]}"; do IFS="=" read -r bin mod <<<"$entry" if command -v "$bin" >/dev/null; then log "✔ $bin already installed – skipping." continue fi log "go install $mod → $bin" GO111MODULE=on go install "$mod" done

------------------------------- 8️⃣ NPM GLOBAL PACKAGES -------------------------------

log "Installing Node‑based CLIs globally (npm) …"

NPM_PKGS=(

The list you gave contained only fkill-cli (already a Rust crate)

Add any other npm‑only tools here, e.g.

"npkill" "http-server"

)

for pkg in "${NPM_PKGS[@]}"; do if npm list -g --depth=0 "$pkg" >/dev/null 2>&1; then log "✔ npm package $pkg already installed" continue fi log "npm installing $pkg globally…" sudo npm install -g "$pkg" || warn "npm install $pkg failed" done

------------------------------- 9️⃣ PIPX PYTHON TOOLS -------------------------------

log "Installing Python‑only CLI tools via pipx …"

PIPX_PKGS=( aichat catai chatblade gpt-engineer gptscript gptui how2 huggingface-cli llm open-interpreter whispercpp chatgpt xlsxsql sd

Misc python tools that are not in apt

(coala, etc. can be installed here if you prefer pipx to apt)

)

for pkg in "${PIPX_PKGS[@]}"; do if pipx list | grep -q "^$pkg "; then log "✔ $pkg already installed via pipx" continue fi log "pipx installing $pkg…" pipx install "$pkg" || warn "pipx install $pkg failed" done

------------------------------- 10️⃣ CLOUD PROVIDER CLIs (official upstream installers) -------------------------------

log "Installing cloud‑provider CLIs that are not in Ubuntu repos…"

── AWS CLI (v2) ──────────────────────

if ! command -v aws >/dev/null; then log "Downloading & installing AWS CLI v2…" curl "https://awscli.amazonaws.com/awscli-exe-linux-x86_64.zip" -o "/tmp/awscliv2.zip" unzip -q /tmp/awscliv2.zip -d /tmp sudo /tmp/aws/install else log "AWS CLI already present (aws – version: $(aws --version))" fi

── Azure CLI (Microsoft repo) ────────

if ! command -v az >/dev/null; then log "Adding Microsoft repo and installing azure‑cli…" curl -sL https://packages.microsoft.com/keys/microsoft.asc | sudo apt-key add - sudo add-apt-repository "deb [arch=amd64] https://packages.microsoft.com/repos/azure-cli/ $(lsb_release -cs) main" sudo apt-get update -y sudo apt-get install -y azure-cli else log "Azure CLI already present (az version: $(az version | head -n1))" fi

── IBM Cloud CLI ─────────────────────

if ! command -v ibmcloud >/dev/null; then log "Downloading IBM Cloud CLI…" curl -fsSL https://clis.cloud.ibm.com/install/linux | sh fi

── DigitalOcean (doctl) ─────────────

if ! command -v doctl >/dev/null; then log "Installing doctl (DigitalOcean CLI)…" curl -sL https://github.com/digitalocean/doctl/releases/latest/download/doctl-$(uname -s)-$(uname -m).tar.gz |
tar -xzv -C /tmp sudo mv /tmp/doctl /usr/local/bin/ fi

── Hetzner Cloud (hcloud) ───────────

if ! command -v hcloud >/dev/null; then log "Installing hcloud CLI…" curl -L https://github.com/hetznercloud/cli/releases/latest/download/hcloud-linux-amd64.tar.gz |
tar -xz -C /tmp sudo mv /tmp/hcloud /usr/local/bin/ fi

── Other provider CLIs (fastly, scaleway, vultr, …)

Each of them typically provides a single binary release on GitHub.

Below is an example helper – you can copy‑paste it for any missing tool:

install_from_github() {

local name=$1 url=$2

if ! command -v "$name" >/dev/null; then

log "Installing $name from $url …"

curl -L "$url" -o "/tmp/${name}.tar.gz"

tar -xzf "/tmp/${name}.tar.gz" -C "/tmp"

sudo mv "/tmp/${name}" "/usr/local/bin/"

else

log "$name already present"

fi

}

install_from_github fastly "https://github.com/fastly/cli/releases/latest/download/fastly_$(uname -s)_$(uname -m).tar.gz"

… (repeat for every provider you need)

------------------------------- 11️⃣ HELM (official script) -------------------------------

if ! command -v helm >/dev/null; then log "Installing Helm via the official script…" curl https://raw.githubusercontent.com/helm/helm/main/scripts/get-helm-3 | bash else log "Helm already installed (helm version: $(helm version --short))" fi

------------------------------- 12️⃣ KUBECTL, KIND, K3D, MINIKUBE -------------------------------

kubectl is already installed via apt above; for the rest use their official binaries:

install_binary() { local name=$1 url=$2 if ! command -v "$name" >/dev/null; then log "Downloading $name…" curl -L "$url" -o "/tmp/$name" chmod +x "/tmp/$name" sudo mv "/tmp/$name" "/usr/local/bin/$name" else log "$name already present" fi }

kind (Kubernetes in Docker)

install_binary kind "https://kind.sigs.k8s.io/dl/v0.23.0/kind-$(uname -s)-$(uname -m)"

k3d (K3s in Docker)

install_binary k3d "https://github.com/k3d-io/k3d/releases/latest/download/k3d-$(uname -s)-$(uname -m)"

minikube

install_binary minikube "https://storage.googleapis.com/minikube/releases/latest/minikube-linux-amd64"

------------------------------- 13️⃣ FINAL PATH TWEAKS -------------------------------

If you sourced the script from a login shell, your PATH is already updated.

To make the changes permanent, append the following line to ~/.bashrc (or ~/.zshrc):

echo 'export PATH="$HOME/.cargo/bin:$HOME/go/bin:$HOME/.local/bin:$PATH"' >> ~/.bashrc log "PATH export added to ~/.bashrc – run 'source ~/.bashrc' or start a new terminal."

------------------------------- 14️⃣ DONE! -------------------------------

log "✅ All requested tools have been processed." log "Run 'which ' or ' --version' to verify any individual binary." log "If you still see “command not found” for a particular tool, it probably" log "needs a manual download (e.g., a GUI‑only binary) – let me know and I’ll help."

exit 0 How to run the script

1️⃣ Save it:

cat > ~/install_all.sh <<'EOS'

(paste the whole script above)

EOS

2️⃣ Make it executable

chmod +x ~/install_all.sh

3️⃣ Run it (it will ask for your sudo password a few times)

./install_all.sh The script:

Stops on the first error (set -e). If you want it to keep going, replace set -e with set +e (but you’ll have to watch the warnings). Logs every major step in green, warnings in yellow, so you can see what succeeded and what didn’t. Leaves the system in a clean state – all binaries are in $HOME/.cargo/bin, $HOME/go/bin or $HOME/.local/bin, which are now permanently added to your $PATH. 📚 What to do if you still get “package not found” Missing package Where to look / how to install procs, gotop, bottom, zenith, fkill-cli, joker, osquery cargo (cargo install ) – already handled in the script. fastfetch, macchina, ismc, viddy, sampler Most are Rust crates – cargo install fastfetch, etc. aichat, catai, chatblade, gpt‑engineer, gptscript, gptui, how2, huggingface-cli, llm, open‑interpreter, whispercpp, chatgpt, xlsxsql, sd Python – pipx install (script does this). awscli sudo apt-get install awscli works on Ubuntu 22.04 LTS if the “universe” repo is enabled. If you prefer the newest v2, use the official bundled installer (script does this). azure-cli Needs the Microsoft APT repo (added by the script). exif, exiftool, pdfcpu, pdfminer Usually Python: pipx install pdfcpu (if a binary exists) or pip install pdfminer.six. starship, eza, k9s Snap – sudo snap install starship, etc. (script does it). helm Official install script (`curl … kubectx/kubens Not in Ubuntu’s base repo – install via snap install kubectx or clone the repo (git clone https://github.com/ahmetb/kubectx.git $HOME/.kubectx && sudo ln -s $HOME/.kubectx/kubectx /usr/local/bin/kubectx). kind, k3d, minikube Binary releases – the script downloads the latest stable version. coala Not packaged – pipx install coala (or pip install coala). gifski Not in Ubuntu 22.04 – cargo install gifski (or use the pre‑built binary from GitHub). cloud provider CLIs (Fastly, Scaleway, Vultr, JDCloud, etc.) Usually a single binary release on GitHub – use the install_from_github helper in the script or add the same pattern yourself. Any other tool Search “ Ubuntu install” or “ GitHub releases”. Most open‑source CLIs provide a pre‑built tarball or a cargo/go/npm/pipx install method. 📦 TL;DR – Minimal manual steps (if you don’t want the whole script) If you prefer a short list of one‑liners for the most common missing items, run the following one after the other inside your WSL Ubuntu:

0️⃣ Make sure you have the “universe” repo (many packages live there)

sudo add-apt-repository -y universe && sudo apt update

1️⃣ Core dev tools

sudo apt-get install -y build-essential curl wget git locales software-properties-common

2️⃣ Language runtimes

sudo apt-get install -y golang # Go curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh -s -- -y # Rust curl -fsSL https://deb.nodesource.com/setup_20.x | sudo -E bash - && sudo apt-get install -y nodejs # Node sudo apt-get install -y python3 python3-pip python3-venv python3 -m pip install --user pipx && python3 -m pipx ensurepath

3️⃣ Add binary dirs to PATH (run once)

echo 'export PATH="$HOME/.cargo/bin:$HOME/go/bin:$HOME/.local/bin:$PATH"' >> ~/.bashrc source ~/.bashrc

4️⃣ Packages that exist in apt

sudo apt-get install -y fd-find ripgrep fzf bat exa ncdu htop duf dust smartmontools ffmpeg imagemagick unzip zip zstd curl wget tree git jq yq

5️⃣ Snap‑only tools (optional)

sudo snap install starship --classic sudo snap install eza --classic sudo snap install k9s --classic

6️⃣ Rust‑based CLIs (cargo)

cargo install procs gotop bottom zenith fkill-cli joker fastfetch macchina ismc viddy sampler aichat catai chatblade gpt-engineer gptscript gptui how2

7️⃣ Go‑based CLIs

go install github.com/schollz/croc/v9@latest # croc go install github.com/dundee/gdu@latest # gdu go install github.com/jesseduffield/lazydocker@latest

8️⃣ Python‑only CLIs (pipx)

pipx install aichat catai chatblade gpt-engineer gptscript gptui how2 huggingface-cli llm open-interpreter whispercpp chatgpt xlsxsql sd

9️⃣ Cloud provider CLIs (example for AWS)

curl "https://awscli.amazonaws.com/awscli-exe-linux-x86_64.zip" -o "/tmp/awscliv2.zip" unzip -q /tmp/awscliv2.zip -d /tmp sudo /tmp/aws/install

10️⃣ Azure CLI

curl -sL https://packages.microsoft.com/keys/microsoft.asc | sudo apt-key add - sudo add-apt-repository "deb [arch=amd64] https://packages.microsoft.com/repos/azure-cli/ $(lsb_release -cs) main" sudo apt update && sudo apt install -y azure-cli Run the block line‑by‑line (or paste the whole thing). After it finishes you will have most of the utilities you asked for, each installed via the method that actually provides it.

🎯 What to remember apt can only give you what Ubuntu ships – everything else needs a language‑specific installer or a direct binary download. Enable the universe repo (and add third‑party repos for Azure CLI, Helm, etc.). Install the language runtimes first (rustup, go, node, pipx) – they are the “package managers for the rest”. Prefer cargo install for Rust tools (procs, gotop, bottom, zenith, fkill-cli, …). Prefer go install for Go tools (croc, gdu, lazydocker, …). Prefer npm -g for JavaScript/Node tools (if any). Prefer pipx install for Python‑only CLIs (AI/LLM helpers, coala, etc.). Use snap for things that only exist as snap packages (starship, eza, k9s). Add the respective binary directories to $PATH (the script does it for you). Once you have those runtimes in place, adding any new CLI from this list in the future is as easy as:

cargo install # Rust go install @latest # Go npm install -g # Node pipx install # Python snap install # Snap That’s the canonical, maintainable workflow for a massive, cross‑language toolbox on Ubuntu WSL.

Enjoy your newly‑armed terminal! 🚀 If you hit a specific package that still refuses to install, paste the exact error message and I’ll help you troubleshoot that one.

Expected Content

No response

koosdoos88 avatar Jan 04 '26 08:01 koosdoos88

Related WSL issues:

  • #9151 - Continue VS Code extension fails to start MCP servers in WSL workspaces (looks for cmd.exe inside Ubuntu)
  • #9136 - @Git Diff context provider fails in WSL (Remote) - "Git shows no current changes"
  • #9326 - Cannot build working VSIX from WSL2 - native binaries mismatch
  • #7810 - WSL
  • #6242 - Docs cannot be added with Ubuntu on WSL (Windows 11)
  • #5996 - Running terminal commands in Agent mode results in an error (WSL)
  • #3764 - Unable to debug the extension from WSL Remote (fork on main)
  • #2822 - Git Diff always returns no changes on WSL
  • #6339 - Failed to parse config (workspace path in WSL2)

continue avatar Jan 04 '26 08:01 continue

This issue hasn't been updated in 90 days and will be closed after an additional 10 days without activity. If it's still important, please leave a comment and share any new information that would help us address the issue.

github-actions[bot] avatar Apr 05 '26 02:04 github-actions[bot]

This issue was closed because it wasn't updated for 10 days after being marked stale. If it's still important, please reopen + comment and we'll gladly take another look!

github-actions[bot] avatar Apr 15 '26 02:04 github-actions[bot]