The sudo: apt-add-repository: command not found
error is one you might encounter when trying to add a third party PPA repository on Debian, Ubuntu, Linux Mint, or any other Linux distribution based on Debian.
PPA repositories are used for installing third party software not available in a system’s official repositories. In this guide, we’ll show you how to remedy this error so you can add these repositories and install the desired software.
In this tutorial you will learn:
- How to fix
apt-add-repository: command not found
error
Category | Requirements, Conventions or Software Version Used |
---|---|
System | Any Debian-based distro |
Software | N/A |
Other | Privileged access to your Linux system as root or via the sudo command. |
Conventions |
# – requires given linux commands to be executed with root privileges either directly as a root user or by use of sudo command$ – requires given linux commands to be executed as a regular non-privileged user |
Solution for apt-add-repository: command not found
If you’re receiving this error, it means that your system is missing the package that allows it to add PPA repositories. The package you will need to install is called software-properties-common
. Simply follow along with the steps below to get it installed on your system.
- Open a terminal and type the following command to fetch the latest repository updates.
$ sudo apt update
- Next, install the
software-properties-common
package.$ sudo apt install software-properties-common
- Finally, you can add any PPA repository you like. Just for an example, we’ll add the one for Firefox and then use it to install the program.
$ sudo apt-add-repository "deb http://ppa.launchpad.net/ubuntu-mozilla-security/ppa/ubuntu focal main" $ sudo apt update $ sudo apt install firefox
That’s all there is to it. The PPA repository has been added, which allows us to install the software from it after we perform the apt update
command.
Conclusion
In this guide, we saw how to resolve the sudo: apt-add-repository: command not found
error on Debian-based systems. We also saw how to add a PPA repository and then install the desired software from it. Having the software-properties-common
package on your system should allow you to add any future PPA repositories as needed.