In some cases on Linux Mint, Linux Lite, Zorin OS, elementary OS and other Ubuntu based distros, as well as Ubuntu and Debian, you’ll see the error that add-apt-repository command is missing.
$ sudo: add-apt-repository: command not found
This tutorial will show you how to quickly fix the “add-apt-repository command not found” error on Debian, Ubuntu and other Debian-based Linux distributions.
What is Personal Package Archive
PPA is a web URL of a personal repository.
Repository is a collection of files that has information about various software, their versions and some other details like the checksum. Each Ubuntu version has its own official set of four repositories.
Most common way to install software on Ubuntu or Debian, if the package is not already in the official repo, is to use PPA (Personal Package Archive).
add-apt-repository is a command line utility for adding PPA (Personal Package Archive) in Ubuntu and Debian Linux.
Adding new PPA (Personal Package Archive) in Ubuntu
If you want to add a new PPA repository, you’ll have to use the add-apt-repository command:
sudo add-apt-repository ppa:some/ppa
sudo add-apt-repository ppa:dr-akulavich/lighttable sudo apt-get update sudo apt-get install lighttable-installer
If you see an error that the command is missing, you must first install the package which contains the add-apt-repository utility.
Fix add-apt-repository: command not found error
So, the add-apt-repository command on newer systems is under the package software-properties-common, and you need to install that package first in order to install add-apt-repository.
Installing the Package on Debian / Ubuntu LTS
If you are using Debian / Ubuntu LTS such as 18.04, 16.04, and 14.04 systems, then install software-properties-common package to get add-apt-repository command.
$ sudo apt-get install -y software-properties-common Reading package lists... Done Building dependency tree Reading state information... Done The following NEW packages will be installed: software-properties-common 0 upgraded, 1 newly installed, 0 to remove and 0 not upgraded. Need to get 9384 B of archives. After this operation, 188 kB of additional disk space will be used. Get:1 http://archive.ubuntu.com/ubuntu/ trusty-updates/main software-properties-common all 0.92.37.8 [9384 B] Fetched 9384 B in 0s (47.0 kB/s) Selecting previously unselected package software-properties-common. (Reading database ... 62966 files and directories currently installed.) Preparing to unpack .../software-properties-common_0.92.37.8_all.deb ... Unpacking software-properties-common (0.92.37.8) ... Processing triggers for man-db (184.108.40.206-1ubuntu1) ... Setting up software-properties-common (0.92.37.8) ...
Note: If you see an error saying software-properties-common package not found, you should run sudo apt-get update and then try to install it again.
Installing the Package on Ubuntu 13.10 and Older
If you are using Ubuntu v13.10 or older, the add-apt-repository command is available under python-software-properties package. So, install that package instead using the apt-get command.
$ sudo apt-get install -y python-software-properties
Once you have installed software-properties-common, or python-software-properties depending on your system, you can now comfortably use add-apt-repository or apt-add-repository commands to add PPA.
Let’s try to add the example PPA previously mentioned in this tutorial:
$ sudo add-apt-repository ppa:dr-akulavich/lighttable Light Table Installer: the package in this PPA downloads and installs the latest builds from http://lighttable.com/ More info: https://launchpad.net/~dr-akulavich/+archive/ubuntu/lighttable Press [ENTER] to continue or ctrl-c to cancel adding it gpg: keyring `/tmp/tmpwybqddzt/secring.gpg' created gpg: keyring `/tmp/tmpwybqddzt/pubring.gpg' created gpg: requesting key 85C79C73 from hkp server keyserver.ubuntu.com gpg: /tmp/tmpwybqddzt/trustdb.gpg: trustdb created gpg: key 85C79C73: public key "Launchpad PPA for Anton Yakutovich" imported gpg: Total number processed: 1 gpg: imported: 1 (RSA: 1) OK $ sudo apt-get update ...... $ sudo apt-get install lighttable-installer Reading package lists... Done Building dependency tree Reading state information... Done The following NEW packages will be installed: lighttable-installer 0 upgraded, 1 newly installed, 0 to remove and 0 not upgraded. Need to get 4292 B of archives. After this operation, 20.5 kB of additional disk space will be used. Get:1 http://ppa.launchpad.net/dr-akulavich/lighttable/ubuntu/ trusty/main lighttable-installer amd64 0.8.0-1~ppa~3 [4292 B] Fetched 4292 B in 0s (18.6 kB/s) ....... Download done. Removing outdated cached downloads... Unpacking lighttable-installer (0.8.0-1~ppa~3) ... Processing triggers for mime-support (3.54ubuntu1.1) ... Setting up lighttable-installer (0.8.0-1~ppa~3) ... Successfully installed in /opt/LightTable
Hopefully this has helped you solve your PPA problems. If not, or you have other questions, leave us a comment below the article.