Why Does the Message “add-apt-repository: command not found” Appear?
Software is usually managed on Debian-based Linux systems via APT (Advanced Package Tool). You can use APT to search, install, update, or remove packages from a user’s system. These packages are stored in repositories, which are huge software collections on remote systems.
You can install software from a repository using your user account with the command:
And remove installed packages with:
Or:
Debian-based systems (including Ubuntu) will come with default repositories in which you can find the most common software.
You can view which repositories your system is currently configured to use with:
When you want to use APT to install software that is not available in a default repository, you will need to add a new repository using the command sudo add-apt-repository, update the system then install the package.
To install the excellent RSS reader, QuiteRSS, for instance, you would type:
However, you may instead receive the error message “sudo: add-apt-repository: command not found”.
This means that the package, “add-apt-repository” is not installed on your system.
How to Fix “sudo: add-apt-repository: command not found”
When a package you need is not installed, you may try to install it with APT, but if you try to install add-apt-repository this way, you will see a further error: “Unable to locate package add-apt-repository”.
This is because add-apt-repository is included as part of a larger package called software-properties-common, which also contains common files for software properties such as the D-Bus backend.
To install software-properties-common, type:
Now when you attempt to add a repository using add-apt-repository, it will work.
You Can Now Use add-apt-repository Without Errors!
After installing the software-properties-common package, you can easily add as many repositories as you please. Remember that despite its excellent reputation for security and malware resistance, Linux is not invulnerable to attacks and not all repositories are safe. Take care and perform due diligence checks when adding repositories.