Ubuntu

Fix sudo: add-apt-repository: command not found error

The software applications can be installed on Ubuntu and Debian systems in many ways. The one common way to install applications is through the Personal Package Archive (PPA) Repository. The PPA’s are the external repositories that are created and maintained by developers.

The add-apt-repository command is used in the following way to add a PPA repository:

$ sudo add-apt-repository ppa: name/ppa

The sudo: add-apt-repository: command not found is a common error that we encounter while adding a PPA repository.

Fixing sudo: add-apt-repository: command not found error

This error is simple, and you face it when the specific package which allows you to add the external repositories is not installed on your system. To fix this error, we need to install the software-properties-common package because the add-apt-repository command is included in this package.

Fire up the terminal and complete the below-given steps to install the software-properties-common package.

Step 1: Update the repository

Execute the given-below command to update the system’s repository:

$ sudo apt update

Step 2: Install the software-properties-common package

Next, install the software-properties-common package with the command:

The software-properties-common package will be successfully installed.

Step 3: Add the PPA repository

Now, the add-apt-repository: command not found error is fixed, and you are ready to add any PPA repository. As an example, let’s add the LibreOffice repository and install it:

$ sudo add-apt-repository ppa:libreoffice/ppa

$ sudo apt update

$ sudo apt install libreoffice

Alright! That’s it. The PPA repository is successfully added to the system, and LibreOffice is successfully installed.

Conclusion

The add-apt-repository: command not found is a very common error that you may encounter while adding the external or PPA repository to the Ubuntu, Debian, Linux Mint, and many other Debian based systems. The add-apt-repository command is included in the software-properties-common package, and the error occurs due to the absence of this package. We can fix this error by installing the software-properties-common package.

About the author

Kamran Sattar Awaisi

I am a software engineer and a research scholar. I like to write article and make tutorial on various IT topics including Python, Cloud Computing, Fog Computing and Deep Learning. I love to use Linux based operating systems.