Flash Sale:75% Off Hosting + Free DomainEnds in13h47m14sView Plans
Hostvento logoHostvento

Fix "add-apt-repository: command not found" on Debian

Install one package and the command works again.

VPS and Cloud Servers2 min read7 steps5 screenshots

The error

You run add-apt-repository and the shell says the command is not found.

The command not found error

The command comes with the package software-properties-common, which Debian does not always install.

Solution 1: Install the package

  1. Open a terminal (Ctrl + Alt + T), or connect by SSH.
  2. Update the package list:
sudo apt update
Updating the package list

Optionally upgrade the system:

sudo apt upgrade -y
  1. Install the package:
sudo apt install software-properties-common
Installing software-properties-common
  1. Check that the command now works:
add-apt-repository --help
The help of add-apt-repository

Solution 2: Manual install

If the first solution does not help:

  1. Install the Python package:
sudo apt install python3-software-properties
Installing python3-software-properties
  1. Create a link so the command is found. Check first that the file path exists on your system:
sudo ln -s /usr/lib/python3/dist-packages/softwareproperties/ppa.py /usr/bin/add-apt-repository
  1. Add a repository. For example, the WineHQ repository:
sudo add-apt-repository "deb https://dl.winehq.org/wine-builds/debian $(lsb_release -cs) main"

To remove a PPA again, use ppa-purge (install it with sudo apt install ppa-purge):

sudo ppa-purge ppa:<ppa_name>

If you still have problems

  • Check the spelling of the commands.
  • You need a working internet connection to add repositories.
  • Debian does not use Ubuntu PPAs in most cases. For Debian, add a repository line or a signed source file instead, as the project of the software advises.
  • Read the documentation of the repository you add.

Quick recap

  • Install software-properties-common.
  • Run add-apt-repository --help to test.
  • Use the manual link only if the package does not help.