Methods of payment Abuse

Ошибка add-apt-repository command not found

30.01.2024, 23:21

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.

What does add-apt-repository command not found mean?

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:

  1. A distribution that is incompatible with deb package management system is used, that's why there is no command, you won't be able to use ppa in Arch, Gentoo, Manjaro, Fedora and so on, there is nothing you can do here;
  2. It's not Ubuntu that is used. The repository management utility is developed by the Ubuntu team and comes by default only with that distribution, on other Debian-based systems you have to install it.
  3. You are typing the command incorrectly. If you are copying a command from some Internet resource, pay attention to hyphens, on many resources they are often replaced by dashes automatically, because of this the command will be incorrect.

Let's see how to solve this problem and eliminate the error.

Fixing 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.