How to Fix curl command not found Error
DodaTech
1 min read
In this tutorial, you'll learn about How to Fix curl command not found Error. We cover key concepts, practical examples, and best practices to help you understand and apply this topic effectively.
The Problem
You type curl and get:
curl: command not found
Or:
bash: curl: command not found
curl is not installed on your system. Many minimal Linux distributions (Docker containers, WSL, minimal cloud images) do not include curl by default.
Quick Fix
Step 1: Install curl
Ubuntu/Debian:
sudo apt update
sudo apt install curl -y
RHEL/CentOS/Fedora:
sudo yum install curl -y
# or
sudo dnf install curl -y
Alpine Linux:
apk add curl
macOS:
brew install curl
Step 2: Verify
curl --version
Expected output:
curl 8.5.0 (x86_64-pc-linux-gnu) libcurl/8.5.0 OpenSSL/3.0.2 zlib/1.2.11
Release-Date: 2023-12-06
Protocols: dict file ftp ftps gopher gophers http https imap imaps ldap ldaps mqtt pop3 pop3s rtmp rtsp smb smbs smtp smtps telnet tftp
Features: alt-svc AsynchDNS GSS-API HSTS HTTP2 HTTPS-proxy IDN IPv6 Kerberos Largefile libz NTLM NTLM_WB SPNEGO SSL threadsafe TLS-SRP UnixSockets
Step 3: Use alternatives if curl is unavailable
If you cannot install curl, use wget:
wget -O filename https://example.com/file
Or netcat for simple HTTP requests:
printf "GET / HTTP/1.1\r\nHost: example.com\r\n\r\n" | nc example.com 80
Alternative Solutions
Use apt or yum to download packages without curl:
# Ubuntu/Debian -- download .deb without curl
apt download curl
sudo dpkg -i curl*.deb
Prevention
- Install curl immediately after setting up a new system.
- Add
curlto Docker images explicitly:RUN apt install -y curl. - Keep a minimal toolset:
curl,wget,git,nano.
← Previous
ComfyUI Workflow Error — How to Fix and Prevent This Common Issue
Next →
How to Fix 'command not found: npm'
Built by the developers of DodaTech
Doda Browser, DodaZIP & Durga Antivirus Pro