Troubleshoot
LinuxmacOSErrorsNetworking

wget: command not found — Fix for macOS, Ubuntu & Minimal Linux

Fix 'wget: command not found' on macOS, Ubuntu, Debian, Alpine, and minimal Linux installs. Includes one-line install commands and a curl fallback.

May 9, 2026·2 min read

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 commandcurl equivalent
wget https://example.com/file.tar.gzcurl -LO https://example.com/file.tar.gz
wget -O output.html https://example.comcurl -L -o output.html https://example.com
wget -q https://example.com/filecurl -sLO https://example.com/file
wget --continue -O file URLcurl -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
wget: command not found — Fix for macOS, Ubuntu & Minimal Linux | VMHeaven Troubleshoot