wget: command not found — Fix for macOS, Ubuntu & Minimal Linux
wget: command not found means wget is not installed. Unlike curl, wget is not bundled with macOS and is absent from many minimal Linux images. The fix is a single package install — but the exact command depends on your OS.
Fix by Operating System
Ubuntu / Debian
sudo apt update && sudo apt install -y wget
CentOS / AlmaLinux / RHEL
sudo dnf install -y wget
# or on older CentOS 7:
sudo yum install -y wget
Alpine Linux
apk add wget
macOS (Homebrew)
brew install wget
If Homebrew is not installed, install it first:
/bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)"
Arch Linux / Manjaro
sudo pacman -S wget
Zsh "command not found" After Install
If you installed wget but still get the error in zsh, your shell may be caching the old PATH. Reload it:
hash -r
# or restart the shell
exec zsh
curl as a Drop-In Alternative
Most things you can do with wget can be done with curl, which is usually pre-installed:
| wget command | curl equivalent |
|---|---|
wget https://example.com/file.tar.gz | curl -LO https://example.com/file.tar.gz |
wget -O output.html https://example.com | curl -L -o output.html https://example.com |
wget -q https://example.com/file | curl -sLO https://example.com/file |
wget --continue -O file URL | curl -L -C - -o file URL |
The -L flag makes curl follow redirects (equivalent to wget's default behavior). -O saves to a file named after the URL's last path segment.
Docker: wget Not Available in Container
In Docker containers based on debian:slim or ubuntu:minimal, install wget in your Dockerfile:
RUN apt-get update && apt-get install -y --no-install-recommends wget \
&& rm -rf /var/lib/apt/lists/*
The --no-install-recommends flag keeps the image smaller by skipping optional dependencies.
Verify the Install
wget --version
# Output: GNU Wget 1.21.x built on linux-gnu