How to fix “bash: add-apt-repository: command not found” error on Ubuntu/Debian Linux

The “bash: add-apt-repository: command not found” error occurs when the add-apt-repository command is not found on your Ubuntu or Debian Linux system. This command is used to add a PPA (Personal Package Archive) to your system, allowing you to install software from a specific repository.

To fix this error, you will need to install the software-properties-common package, which provides the add-apt-repository command. You can do this by running the following command:

sudo apt-get install software-properties-common

Alternatively, you can install the package python3-software-properties for python3, this package contains the add-apt-repository command.

sudo apt-get install python3-software-properties

Once the package is installed, you should be able to use the add-apt-repository command without issues.

Please note that before installing any package, it’s recommended to have a backup plan in case something goes wrong, and also to test the installation before applying it to your production environment.

Also, it’s worth noting that the add-apt-repository command is deprecated and it’s recommended to use apt-add-repository instead, this command is available on newer versions of Ubuntu and Debian.

Leave a Comment