Debian and Ubuntu have many different programs that will be sufficient to meet the needs of most users. But there are special utilities that are not yet in the repositories. It is therefore quite common for Ubuntu, Debian, Linux Mint and other systems to use PPA repositories.
As a rule, such repositories are maintained either by software developers, so there will always be a new version there, or by volunteers, they add programs that are not in the official repositories. But when you try to add a repository to your system, you may get the error add-apt-repository command not found.
If you translate the word combination, you will get the following - the add-apt-repository command is not found in the system. And if this program is not found in your distribution, then adding a repository will be problematic for the following reasons:
Let's see how to solve this problem and eliminate the error.
The easiest way is to install the package that contains the program we need. It is available in the official repositories of most distributions.
To do this, run the command:
sudo apt install software-properties-common
The system may show that the package is installed, but despite this keep throwing errors when trying to install the PPA:
This happens because of errors during installation. The system thinks that the package is installed, but in fact there are no files of this package in the file system, to solve the problem we can reinstall it:
sudo apt install --reinstall software-properties-common
In Ubuntu versions below 13.10, this package had a different name, python-software-properties. If this is your case, then use:
sudo apt install python-software-properties
To make sure that the package is installed correctly and all files are where they should be, you can use the command:
dpkg -L software-properties-common
Execute the file directly:
sudo /usr/bin/add-apt-repository
Make sure you have execute permissions:
ls -l /usr/bin/add-apt-repository
If you have done everything correctly, this error will not bother you anymore.