How to Fix add-apt-repository command not found on Ubuntu & Debian

Debian Repo Fix

Introduction

The ‘add-apt-repository command not found’ Ubuntu error appears when trying to add a new software repository. This indicates that the add-apt-repository package is missing from your system.

This tutorial resolves the ‘add-apt-repository command not found error on Ubuntu and Debian-based Linux distributions.

Prerequisites

Steps to Resolve add-apt-repository: command not found error

Step 1: Update Local Ubuntu Repositories

Open a terminal window and enter the command to update repositories:

sudo apt update

The system confirms that the software repositories list on your local machine is updating.

Step 2: Install the software-properties-common Package

The add-apt-repository command is not a regular package that can be installed with apt on Ubuntu LTS / Debian. Instead, it’s a component of the software-properties-common package.

To get the add-apt-repository command, install the software-properties-common package:

sudo apt install software-properties-common

This is an example output after a successful installation:

Then, update the repository again with:

sudo apt update

Now commands to add repos like such can be ran:

sudo add-apt-repository ppa:mysteriumnetwork/node
or
# sudo add-apt-repository ppa:libreoffice/ppa

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.

Good luck and happy apt-getting with your new REPOs!

Related: