-bash: wget: command not found on a server, or zsh: command not found: wget on a Mac, means exactly what it says: wget is not installed. macOS has never shipped it, and minimal Linux images — cloud templates, debian:*-slim, ubuntu and most other container bases — leave it out to save space.
One package install fixes it. The command depends on the system, so check that first if you are not sure what you are logged into.
grep -E '^(ID|VERSION_ID)=' /etc/os-releaseInstall wget on Linux
Ubuntu and Debian
Refresh the package index first. On a fresh image it is often empty, and apt then reports that the package cannot be found — a second error that has the same cause.
sudo apt update
sudo apt install -y wgetRocky, AlmaLinux, RHEL, CentOS and Fedora
sudo dnf install -y wget
# CentOS 7 and other releases that still use yum
sudo yum install -y wgetRecent Fedora releases ship wget2 and install it when you ask for wget. The command name stays the same and everyday options behave the same, so scripts keep working.
Alpine
Alpine usually has a small BusyBox wget built in. If it is missing, or a script fails with wget: unrecognized option, install the full GNU version:
apk add --no-cache wgetArch and openSUSE
# Arch, Manjaro
sudo pacman -S --needed wget
# openSUSE
sudo zypper install -y wgetInstall wget on macOS
macOS includes curl but not wget. The usual route is Homebrew:
brew install wgetIf brew is also “command not found”, install Homebrew first. On Apple Silicon it lives in /opt/homebrew/bin, and the installer finishes by printing two lines that add it to your PATH — run them, or the next terminal will not find brew either.
/bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)"
# Apple Silicon: put brew on the PATH for zsh
echo 'eval "$(/opt/homebrew/bin/brew shellenv)"' >> ~/.zprofile
eval "$(/opt/homebrew/bin/brew shellenv)"MacPorts users can run sudo port install wget instead.
wget on Windows
Windows PowerShell 5.1 has an alias called wget, but it points to Invoke-WebRequest, which takes different options. PowerShell 7 removed that alias, so there you get The term ‘wget’ is not recognized. You have three options:
# 1. curl.exe ships with Windows 10 (1803+) and Windows 11
curl.exe -LO https://example.com/file.zip
# 2. the native cmdlet
Invoke-WebRequest -Uri https://example.com/file.zip -OutFile file.zip
# 3. install a real GNU wget
winget install JernejSimoncic.WgetInside WSL you are on Linux, so the Ubuntu or Debian command above applies.
wget inside a Docker container
Container images are built without wget, and you are usually root inside them, so there is no sudo. Install it in the Dockerfile rather than in a running container, because anything installed by hand disappears when the container is recreated.
RUN apt-get update \
&& apt-get install -y --no-install-recommends wget ca-certificates \
&& rm -rf /var/lib/apt/lists/*Installed, but still “command not found”
- The shell cached the old lookup. Run
hash -rin bash orrehashin zsh, or simply open a new terminal. - The directory is not on your PATH.
command -v wgetprints the path if the shell can see it. If it prints nothing butls /usr/bin/wgetshows the file, checkecho $PATHfor something your.bashrcor.zshrcoverwrote. - It works for you but not under sudo. sudo uses its own
secure_path. On RHEL-family systems that path leaves out/usr/local/bin, so a wget you built yourself is invisible to sudo. Use the full path or install the distribution package.
command -v wget
wget --version | head -1No wget? curl does the same job
curl is present on most systems that lack wget, including macOS. These are the direct equivalents of the wget commands people use most:
wget https://example.com/file.tar.gz
curl -LO https://example.com/file.tar.gz
wget -O out.html https://example.com
curl -L -o out.html https://example.com
wget -qO- https://example.com/install.sh
curl -fsSL https://example.com/install.sh
wget -c https://example.com/big.iso # resume a download
curl -L -C - -O https://example.com/big.iso-L makes curl follow redirects, which wget does by default. Only recursive downloads (wget -r, --mirror) have no curl equivalent. If you need them, install wget. If curl is missing as well, see curl: command not found.
Meeting this on a brand-new VPS usually means a minimal image. Our initial server setup checklist covers the other things worth doing in the first ten minutes.
Frequently asked
Why is wget not installed on my Mac?
Apple has never shipped wget with macOS; it includes curl instead. Install wget with Homebrew ('brew install wget') or use 'curl -LO <url>', which does the same for simple downloads.
Is wget or curl better on a server?
Both are fine for downloads. wget is handy for resuming and recursive mirroring; curl handles APIs, headers and uploads better. Many minimal images ship one or neither, so scripts should not assume either.
wget is installed but still not found — why?
The shell cached the old lookup or the binary is not on your PATH. Run 'hash -r' (bash) or 'rehash' (zsh), then check 'command -v wget' and your $PATH.