add-apt-repository: command not found
Fix for Ubuntu, Debian, Linux Mint and WSL — updated May 2026
sudo: add-apt-repository: command not found
# or:
bash: add-apt-repository: command not found
⚡ Quick Fix (Ubuntu / Debian / WSL)
After this, add-apt-repository will be available. Run your original command again.
Why Does This Happen?
add-apt-repository is provided by the software-properties-common package. On a minimal Ubuntu or Debian installation — like a VPS, Docker container, or fresh WSL instance — this package is not installed by default. It must be added manually.
The sudo: add-apt-repository: command not found variant means sudo found the command isn't in any location in the secure PATH. The fix is identical.
Fix on Ubuntu / Debian / Linux Mint
Fix on WSL (Windows Subsystem for Linux)
WSL uses Ubuntu or Debian under the hood — the same fix applies. If apt itself is throwing errors first, run:
Fix in a Docker Container
Minimal Docker images (like ubuntu:22.04) strip out many packages. Use:
Note: no sudo needed inside most Docker containers — you're already root.
Alternative: Without add-apt-repository
If you only need to add a PPA or repository, you can also add it manually by editing /etc/apt/sources.list.d/: