How to Fix bash: wget: command not found in Linux

Working in a Linux terminal or deploying automated bash scripts inside a cloud virtual machine or Docker container frequently requires downloading remote packages, certificates, or source archives via the command line. However, entering a download command only to receive the shell response bash: wget: command not found brings your deployment pipeline to an abrupt stop. Modern minimal container images (such as Alpine, Debian slim, Ubuntu minimal, or CentOS Stream) intentionally exclude non-essential utility packages to reduce overall image attack surfaces and footprint. Installing the official GNU Wget utility via your distribution package manager or substituting native curl commands resolves the error immediately.

Install Wget on Debian, Ubuntu, and Linux Mint

On Debian-derived distributions, the APT package cache must be refreshed prior to installing the GNU Wget package.

  1. Open your terminal and ensure you have administrative privileges.
  2. Update your local package repository index:
    sudo apt update
  3. Install the official Wget package:
    sudo apt install -y wget
  4. Verify successful installation and review the installed release version:
    wget --version

Install Wget on RHEL, Fedora, Rocky Linux, and AlmaLinux

Enterprise Linux systems using the DNF or YUM package managers provide Wget directly from base repositories.

  1. Execute the installation command using DNF (or YUM on older releases):
    sudo dnf install -y wget
  2. If using Arch Linux or Manjaro, install Wget via pacman:
    sudo pacman -Sy wget
  3. If operating inside a minimal Alpine Linux Docker container, use the lightweight Alpine package keeper:
    apk add --no-cache wget

Use Native cURL as an Immediate Drop-in Alternative

If you cannot install new packages immediately due to restricted environment permissions, many minimal systems bundle curl by default.

  1. Check if cURL is present on your system:
    which curl
  2. To download a remote file and save it with its original filename (replicating standard wget URL behaviour), use the -O (uppercase O) flag:
    curl -O https://example.com/archive.tar.gz
  3. To follow redirects automatically, add the -L flag:
    curl -LO https://example.com/archive.tar.gz
  4. To resume an interrupted download (equivalent to wget -c), add the -C - flag:
    curl -C - -LO https://example.com/archive.tar.gz

Get the best tech tips delivered straight to your inbox.

Join thousands of readers mastering Apple, Google, Microsoft, and Linux.