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.
sudo apt update
sudo apt install -y wgetbrew install wgetWhich 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.
| Message | Printed by | Cause and fix |
|---|---|---|
bash: wget: command not found | bash; with a leading -bash: in an SSH session (a login shell) | Not installed. Install on Linux |
zsh: command not found: wget | zsh, the default shell on macOS | Not installed; macOS never ships it. macOS or Linux |
/bin/sh: 1: wget: not found | dash (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 found | Not installed; in a Dockerfile, the image has no wget. Docker |
wget: unrecognized option: show-progress | BusyBox wget on Alpine (glibc builds print the option in quotes instead) | A GNU-only option. Alpine |
sudo: 'wget': command not found | sudo-rs on Ubuntu 25.10 and 26.04; classic sudo prints sudo: wget: command not found | Not installed, or outside sudo’s PATH. sudo |
Command 'wget' not found, but can be installed with: | Ubuntu's command-not-found helper | Not installed. Take the apt line. Ubuntu |
exec: "wget": executable file not found in $PATH | docker exec, kubectl exec, a container health check | The image has no wget. Docker |
'wget' is not recognized as an internal or external command, | Windows cmd | Windows has no wget. Windows |
wget: The term 'wget' is not recognized as a name of a cmdlet, function, script file, or executable program. | PowerShell 7 | Same. Windows |
Not sure which Linux you are on? The package manager is what matters:
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 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.
sudo apt update
sudo apt install -y wgetA 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
sudo dnf install -y wgetReleases from before dnf, such as CentOS 7 and RHEL 7, use yum:
sudo yum install -y wgetSince 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:
wget: unrecognized option: show-progressInstall the full GNU version; it takes over the wget command:
apk add --no-cache wgetIf 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
sudo pacman -S --needed wgetsudo zypper install -y wgetInstall 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:
brew install wgetIf 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.)
/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:
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:
'wget' is not recognized as an internal or external command,
operable program or batch file.And in PowerShell 7:
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:
# 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.Wgetwinget 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.
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. Runhash -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. 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_pathfrom/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/binis invisible to sudo on every distribution. Comparecommand -v wgetwithsudo 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 errorsudo: 'wget': command not found.
Verify that it worked
command -v wget
wget --version | head -1
wget -q --spider https://example.com && echo OK/usr/bin/wget
GNU Wget 1.21.3 built on linux-gnu.
OKIf 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:
| Task | wget | curl |
|---|---|---|
| Download a file under its own name | wget URL | curl -LO URL |
| Save under another name | wget -O FILE URL | curl -L -o FILE URL |
| Print to the terminal, for example an install script | wget -qO- URL | curl -fsSL URL |
| Resume an interrupted download | wget -c URL | curl -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.