Install add-apt-repository in Ubuntu / Debian

add-apt-repository is normally installed by default in Ubuntu and Debian distribution, but not in some variance such as Raspbian. As such, you'll get the following command not found error when trying to add a repository to your system;

$ sudo add-apt-repository ppa:ondrej/php
sudo: add-apt-repository: command not found

To have it on your system, you'll have to install software-properties-common as the following;

  1. Update package information
    $ sudo apt update
  2. Upgrade Installed packages
    $ sudo apt -y upgrade
  3. Install software-properties-common
    $ sudo apt -y install software-properties-common

Sign up for Ubuntu Linux Fundamentals - Learn Linux Server with Ubuntu and many other great courses on Udemy to learn more.


Written by Mohd Shakir Zakaria. Last updated on 2019-02-12