Package Manager

add-apt-repository: command not found

Fix for Ubuntu, Debian, Linux Mint and WSL — updated May 2026

🐧 Ubuntu 🐧 Debian 🪟 WSL 🌿 Linux Mint
$ sudo add-apt-repository ppa:example/ppa
sudo: add-apt-repository: command not found

# or:
bash: add-apt-repository: command not found

⚡ Quick Fix (Ubuntu / Debian / WSL)

sudo apt update && sudo apt install -y software-properties-common

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

# Step 1: Update package lists sudo apt update # Step 2: Install software-properties-common sudo apt install -y software-properties-common # Step 3: Verify add-apt-repository --version

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:

sudo apt-get update --fix-missing sudo apt-get install -y software-properties-common

Fix in a Docker Container

Minimal Docker images (like ubuntu:22.04) strip out many packages. Use:

apt-get update && apt-get install -y software-properties-common

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/:

# Add repo key curl -fsSL https://example.com/gpg.key | sudo gpg --dearmor -o /etc/apt/trusted.gpg.d/example.gpg # Add repo manually echo "deb https://example.com/apt stable main" | sudo tee /etc/apt/sources.list.d/example.list sudo apt update