Categories: Ubuntu

How to fix sudo: add-apt-repository: command not found error on Linux Ubuntu





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:

$
Sponsored
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:

Sponsored

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.

Ubuntu Server Admin

Recent Posts

When Your Hash Becomes a String: Hunting Ruby’s Million-to-One Memory Bug

Every developer who maintains Ruby gems knows that sinking feeling when a user reports an…

5 hours ago

Why we brought hardware-optimized GenAI inference to Ubuntu

On October 23rd, we announced the beta availability of silicon-optimized AI models in Ubuntu. Developers…

5 days ago

Canonical and NVIDIA BlueField-4: a foundation for zero-trust high performance infrastructure

At NVIDIA GTC Washington D.C., Canonical is pleased to support the arrival of the NVIDIA…

6 days ago

Global-ready from day one

How Anbox Cloud streamlines localization testing Wherever users are based, they expect apps to just…

1 week ago

Canonical announces new optimized Ubuntu image for Thundercomm RUBIK Pi 3

Ubuntu now runs natively on the Thundercomm RUBIK Pi 3 developer board – a lightweight…

2 weeks ago