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

Executing an automated setup script, querying a REST API endpoint, or installing developer toolchains like Node.js or Rust in a Linux terminal only to have the shell return bash: curl: command not found brings your development workflow to an abrupt stop. While cURL is an industry standard across modern computing, minimal Linux distribution images (such as Ubuntu minimal, Debian slim, CentOS Stream, or Alpine Linux containers) strip out non-essential utilities to reduce container footprint and attack surfaces. Installing the official cURL package via your system package manager or substituting native alternatives restores command-line HTTP transfer capabilities immediately.

Install cURL on Debian, Ubuntu, and Linux Mint

On Debian-derived distributions, update your package index before installing cURL and its accompanying SSL certificate dependencies.

  1. Open your terminal and ensure you have administrative privileges.
  2. Update your local package repository index:
    sudo apt update
  3. Install the official cURL package along with CA certificates:
    sudo apt install -y curl ca-certificates
  4. Verify that the command is successfully installed:
    curl --version

Install cURL on RHEL, Fedora, Rocky Linux, and Alpine

Enterprise distributions and container images provide cURL directly through their primary package repositories.

  1. On Fedora, RHEL, CentOS, Rocky Linux, or AlmaLinux, install cURL via DNF:
    sudo dnf install -y curl
  2. On Arch Linux or Manjaro, install using pacman:
    sudo pacman -Sy curl
  3. On Alpine Linux containers, install the lightweight cURL package via apk:
    apk add --no-cache curl

Use Native Wget or Python as an Immediate Fallback

If you cannot install packages immediately due to restricted container repository access, alternative HTTP download utilities can execute the transfer.

  1. Check if wget is available to download remote files:
    wget -O output.file https://example.com/file
  2. If Python 3 is installed, use its native HTTP module to fetch URLs from the terminal:
    python3 -c "import urllib.request; urllib.request.urlretrieve('https://example.com/file', 'output.file')"
  3. To perform a basic HTTP GET request and print responses to the console with Python:
    python3 -c "import urllib.request; print(urllib.request.urlopen('https://api.ipify.org').read().decode())"

Get the best tech tips delivered straight to your inbox.

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