Getting a "curl: command not found" error in WSL (Windows Subsystem for Linux)? This guide shows you how to install curl on different Linux distributions running in WSL.
Quick Fix for Ubuntu/Debian WSL
Run this command in your WSL terminal:
sudo apt update && sudo apt install curl -y
That's it! Curl is now installed. Verify with:
curl --version
Why Is Curl Not Found?
Common reasons for the error:
- Minimal installation - Some WSL images don't include curl by default
- Fresh WSL instance - New installations have limited packages
- Lightweight distro - Alpine and minimal images exclude curl
- PATH issues - Rare, but possible if system configuration is modified
Install curl by Distribution
Ubuntu / Debian / Linux Mint
sudo apt update
sudo apt install curl -y
Fedora
sudo dnf install curl -y
Alpine Linux
apk update
apk add curl
Arch Linux
sudo pacman -S curl
openSUSE
sudo zypper install curl
CentOS / RHEL / Rocky Linux
# CentOS 8+ / Rocky / Alma
sudo dnf install curl -y
# CentOS 7
sudo yum install curl -y
Verify Installation
After installing, verify curl works:
# Check version
curl --version
# Check location
which curl
# Test with a request
curl -I https://example.com
Expected output:
curl 7.81.0 (x86_64-pc-linux-gnu) libcurl/7.81.0 OpenSSL/3.0.2 zlib/1.2.11 ...
Protocols: dict file ftp ftps gopher gophers http https ...
Features: alt-svc AsynchDNS brotli GSS-API HSTS HTTP2 ...
Troubleshooting
Permission Denied
If you get "permission denied" errors:
# Make sure you're using sudo
sudo apt install curl
Package Not Found
If apt can't find curl:
# Update package lists first
sudo apt update
# Then install
sudo apt install curl
Still Getting "Command Not Found" After Installing
Check if PATH is correct:
# See where curl is installed
whereis curl
# Check current PATH
echo $PATH
# Try running with full path
/usr/bin/curl --version
If curl is installed but not in PATH, add it to your ~/.bashrc:
export PATH=$PATH:/usr/bin
Then reload:
source ~/.bashrc
WSL Not Starting / Network Issues
If WSL has network problems:
# In PowerShell (as Administrator)
wsl --shutdown
wsl
Alternative: Use wget Instead
If you can't install curl, wget is often pre-installed and works similarly:
# Check if wget is available
wget --version
# Download a file
wget https://example.com/file.zip
# Make a request (similar to curl)
wget -qO- https://api.example.com/data
Install wget if needed:
sudo apt install wget -y
Using Windows curl from WSL
Windows 10/11 includes curl.exe. You can call it from WSL:
# Call Windows curl from WSL
curl.exe --version
# Make a request with Windows curl
curl.exe https://example.com
However, this isn't recommended as:
- Different behavior from Linux curl
- Line ending issues (CRLF vs LF)
- May not support all Linux curl options
Install the Linux version for best compatibility.
Common curl Commands
Once installed, here are useful curl commands:
# Download a file
curl -O https://example.com/file.zip
# Download and save with custom name
curl -o myfile.zip https://example.com/file.zip
# Follow redirects
curl -L https://example.com/redirect
# Show response headers only
curl -I https://example.com
# Send POST request with JSON
curl -X POST -H "Content-Type: application/json" \
-d '{"key":"value"}' https://api.example.com/data
# Include response headers in output
curl -i https://example.com
# Silent mode (no progress bar)
curl -s https://example.com
# Verbose output (debugging)
curl -v https://example.com
Summary
To fix "curl: command not found" in WSL:
- Ubuntu/Debian:
sudo apt update && sudo apt install curl -y - Fedora:
sudo dnf install curl -y - Alpine:
apk add curl - Arch:
sudo pacman -S curl
Verify with curl --version after installation.