Troubleshooting

wget: command not found? Install wget on Linux, macOS and Windows

wget is not installed. Fix: sudo apt install wget on Debian and Ubuntu, brew install wget on macOS, apk add wget on Alpine. Plus Windows, Docker and curl.

Published · Updated ~7 min read
On this page

Short answer: -bash: wget: command not found on a server, or zsh: command not found: wget on a Mac, means wget is not installed. macOS has never shipped it, and minimal Linux images (debian:*-slim, ubuntu and most other container bases, and some stripped-down server templates) leave it out. One package fixes it: sudo apt install -y wget on Debian and Ubuntu, brew install wget on macOS, sudo dnf install -y wget on Rocky, Alma and Fedora. If all you need is one download, curl -LO URL does it without installing anything.

Ubuntu · Debian
sudo apt update
sudo apt install -y wget
macOS · Homebrew
brew install wget

Which error do you see?

The wording tells you which shell or tool printed it, and that points to the cause. The shell messages below were reproduced with bash 5.2, dash 0.5.12, zsh 5.9 and BusyBox 1.35.

MessagePrinted byCause and fix
bash: wget: command not foundbash; with a leading -bash: in an SSH session (a login shell)Not installed. Install on Linux
zsh: command not found: wgetzsh, the default shell on macOSNot installed; macOS never ships it. macOS or Linux
/bin/sh: 1: wget: not founddash (Debian, Ubuntu) in a Dockerfile RUN line or a cron job; a #!/bin/sh script prints its own name and line instead, as in ./install.sh: 3: wget: not foundNot installed; in a Dockerfile, the image has no wget. Docker
wget: unrecognized option: show-progressBusyBox wget on Alpine (glibc builds print the option in quotes instead)A GNU-only option. Alpine
sudo: 'wget': command not foundsudo-rs on Ubuntu 25.10 and 26.04; classic sudo prints sudo: wget: command not foundNot installed, or outside sudo’s PATH. sudo
Command 'wget' not found, but can be installed with:Ubuntu's command-not-found helperNot installed. Take the apt line. Ubuntu
exec: "wget": executable file not found in $PATHdocker exec, kubectl exec, a container health checkThe image has no wget. Docker
'wget' is not recognized as an internal or external command,Windows cmdWindows has no wget. Windows
wget: The term 'wget' is not recognized as a name of a cmdlet, function, script file, or executable program.PowerShell 7Same. Windows

Not sure which Linux you are on? The package manager is what matters:

any Linux shell
grep -E '^(ID|VERSION_ID)=' /etc/os-release

Install wget on Linux

Ubuntu and Debian

Refresh the package index first. On a fresh image it is often empty, and apt then reports E: Unable to locate package wget (Error: instead of E: with apt on Debian 13 and Ubuntu 26.04), a second error with the same cause.

Ubuntu · Debian
sudo apt update
sudo apt install -y wget

A full Debian install has wget, because Debian rates it a standard package that the installer’s “standard system utilities” task pulls in. It is the container images and stripped-down templates that lack it. On Ubuntu, an interactive shell may answer with the command-not-found helper, Command 'wget' not found, but can be installed with:, followed by the install command. Take the apt install line.

Rocky, AlmaLinux, RHEL, CentOS and Fedora

Rocky · Alma · RHEL · Fedora
sudo dnf install -y wget

Releases from before dnf, such as CentOS 7 and RHEL 7, use yum:

CentOS 7 · RHEL 7
sudo yum install -y wget

Since Fedora 40, asking for wget installs wget2 with a shim that keeps the wget command name. Most options behave the same; FTP downloads and WARC output are what it does not support.

Alpine

Alpine has a small BusyBox wget built in, so plain downloads work out of the box, HTTPS included. It knows only a handful of options (-c, -q, -O, -P, -S, -T, -U, --header, --post-data, --spider and a few more). Recursive downloads (-r, --mirror), -N, -i, --limit-rate or --show-progress stop with an error and BusyBox’s usage text:

Alpine · example output
wget: unrecognized option: show-progress

Install the full GNU version; it takes over the wget command:

Alpine
apk add --no-cache wget

If the BusyBox build has no wget applet at all, the shell says sh: wget: not found, or -sh: wget: not found in a login shell, and the same command fixes it.

Arch and openSUSE

Arch · Manjaro
sudo pacman -S --needed wget
openSUSE
sudo zypper install -y wget

Install wget on macOS

macOS includes curl but not wget, so zsh: command not found: wget is expected on every Mac. The usual route is Homebrew:

macOS · Homebrew
brew install wget

If brew is “command not found” too, install Homebrew first. It lives in /opt/homebrew on Apple Silicon, and the current installer supports Apple Silicon only. It finishes with “Next steps” lines that add brew to your ~/.zprofile. Run them, or the next terminal may not find brew either. (Since mid-2025 the installer also writes /etc/paths.d/homebrew when it can use sudo, which puts /opt/homebrew/bin on the PATH of new terminals.)

macOS · install Homebrew
/bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)"

The “Next steps” lines look like this. Older guides leave out the zsh after shellenv; both forms work:

macOS · put brew on the PATH for zsh
echo >> ~/.zprofile
echo 'eval "$(/opt/homebrew/bin/brew shellenv zsh)"' >> ~/.zprofile
eval "$(/opt/homebrew/bin/brew shellenv zsh)"

brew install wget succeeded but zsh still cannot find it? Then /opt/homebrew/bin is not on your PATH yet: run the last line above, then rehash. An Intel Mac that already has Homebrew keeps it in /usr/local/bin, which is on the PATH already. A new install on an Intel Mac stops with Homebrew on macOS is only supported on Apple Silicon processors!; there, use MacPorts (sudo port install wget) or curl.

wget on Windows

Windows has no wget. In cmd the error reads:

cmd · example output
'wget' is not recognized as an internal or external command,
operable program or batch file.

And in PowerShell 7:

PowerShell 7 · example output
wget: The term 'wget' is not recognized as a name of a cmdlet, function, script file, or executable program.
Check the spelling of the name, or if a path was included, verify that the path is correct and try again.

Windows PowerShell 5.1 does not complain: there wget is an alias for Invoke-WebRequest, which takes different options, so GNU-style flags fail and a plain wget URL prints the response instead of saving a file. PowerShell 7 removed that alias. You have three options:

PowerShell
# 1. curl.exe ships with Windows 10 (1803+), Windows 11 and Windows Server 2019+
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, then open a new terminal
winget install JernejSimoncic.Wget

winget adds the program to your PATH, which only terminals opened afterwards see. Inside WSL you are on Linux, so the Ubuntu or Debian command above applies.

wget inside a Docker container

Debian and Ubuntu images are built without wget, and you are usually root inside them, so there is no sudo. Called from outside, through docker exec or a health check, the runtime reports exec: "wget": executable file not found in $PATH. Install wget in the Dockerfile rather than in a running container, because anything installed by hand disappears when the container is recreated.

Dockerfile · Debian or Ubuntu base
RUN apt-get update \
 && apt-get install -y --no-install-recommends wget ca-certificates \
 && rm -rf /var/lib/apt/lists/*

On an Alpine base, BusyBox wget is already there; add RUN apk add --no-cache wget only if a script needs GNU options.

Installed, but still “command not found”

  • The shell cached the old lookup. If wget moved, bash keeps trying the remembered path and prints bash: /usr/local/bin/wget: No such file or directory. Run hash -r in bash or rehash in zsh, or simply open a new terminal.
  • The directory is not on your PATH. command -v wget prints the path if the shell can see it. If it prints nothing but ls /usr/bin/wget shows the file, check echo $PATH for something your .bashrc or .zshrc overwrote. PATH lists directories: add /usr/local/bin, never /usr/local/bin/wget.
  • It works for you but not under sudo. sudo replaces your PATH with secure_path from /etc/sudoers. On RHEL, Rocky and Alma 9 and 10 that is /sbin:/bin:/usr/sbin:/usr/bin, without /usr/local/bin, so a wget you built yourself is invisible to sudo; a copy in a conda environment or ~/.local/bin is invisible to sudo on every distribution. Compare command -v wget with sudo sh -c 'command -v wget', then install the distribution package or give sudo the full path. sudo-rs, the default sudo on Ubuntu 25.10 and 26.04, words the error sudo: 'wget': command not found.

Verify that it worked

Linux · macOS
command -v wget
wget --version | head -1
wget -q --spider https://example.com && echo OK
Example output · Debian 12
/usr/bin/wget
GNU Wget 1.21.3 built on linux-gnu.
OK

If wget --version answers unrecognized option and BusyBox’s usage text, the shell found the BusyBox applet, not GNU wget. If the third command prints nothing, run it again without -q to see why; a certificate error there means ca-certificates is missing.

No wget? curl does the same job

curl is present on most systems that lack wget, including macOS and Windows, and our curl command examples go well beyond downloads. These are the direct equivalents of the wget commands people use most:

Taskwgetcurl
Download a file under its own namewget URLcurl -LO URL
Save under another namewget -O FILE URLcurl -L -o FILE URL
Print to the terminal, for example an install scriptwget -qO- URLcurl -fsSL URL
Resume an interrupted downloadwget -c URLcurl -L -C - -O URL

-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. A downloaded archive is usually a .tar.gz file to extract next.

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.

Another tool missing, or a directory to add to PATH for good in bash, zsh and fish? See command not found: the three causes and the fix for every tool.

Frequently asked

Why is wget not installed on my Mac?

Apple has never shipped wget with macOS, so zsh answers 'zsh: command not found: wget'. Install it with Homebrew ('brew install wget') or use 'curl -LO URL', which does the same for a single download.

Why does wget on Alpine say 'unrecognized option'?

Alpine's built-in wget is the small BusyBox version, which knows only basic options such as -O, -q and -c. GNU options like --show-progress, -r or -N stop with 'wget: unrecognized option'. 'apk add --no-cache wget' installs GNU wget, which takes over the wget command.

How do I fix 'wget' is not recognized as an internal or external command on Windows?

Windows has no wget. Use the built-in curl.exe ('curl.exe -LO URL'), PowerShell's Invoke-WebRequest, or install GNU wget with 'winget install JernejSimoncic.Wget' and open a new terminal. In Windows PowerShell 5.1, wget is an alias for Invoke-WebRequest, which takes different options.

Related articles

All troubleshooting