Fix ‘add-apt-repository command not found’ Error on Ubuntu and Debian

This quick tutorial shows you how to quickly fix the “add-apt-repository command not found” error on Debian, Ubuntu and other Debian-based Linux distributions.

One of the many ways to install software on Ubuntu or Debian is to use a PPA (Personal Package Archive).

If you want to add a new PPA repository, you’ll have to use the add-apt-repository command in the following fashion:

sudo add-apt-repository ppa:some/ppa

In Debian, elementary OS and sometimes on Ubuntu, you’ll see the error that the add-apt-repository command is missing.

sudo: add-apt-repository: command not found

Let’s see how to fix this annoying error.

Fix add-apt-repository: command not found error

The error is simple. The package add-apt-repository is not installed on your system.

But if you try to use sudo apt-get install add-apt-repository, it won’t work.

It’s because the add-apt-repository command is part of package software-properties-common and you need to install this package in order to install add-apt-repository.

So open a terminal and use this command:

sudo apt-get install software-properties-common

The command’s output will be something like this:

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 9,912 B of archives.
After this operation, 197 kB of additional disk space will be used.
Get:1 http://us.archive.ubuntu.com/ubuntu bionic-updates/main amd64 software-properties-common all 0.96.24.32.5 [9,912 B]
Fetched 9,912 B in 2s (5,685 B/s)                      
Selecting previously unselected package software-properties-common.
(Reading database ... 265950 files and directories currently installed.)
Preparing to unpack .../software-properties-common_0.96.24.32.5_all.deb ...
Unpacking software-properties-common (0.96.24.32.5) ...
Processing triggers for man-db (2.8.3-2) ...
Processing triggers for dbus (1.12.2-1ubuntu1) ...
Setting up software-properties-common (0.96.24.32.5) ...

Once you’ve installed software-properties-common, you should update the system using this command:

sudo apt-get update

You can now comfortably use add-apt-repository or apt-add-repository commands to add PPAs.

Note: If you see an error saying software-properties-common command not found, you should run sudo apt-get update and then try to install it again.

I hope this quick tip helped you fix the “add-apt-repository: command not found” error on Ubuntu and other Debian-based Linux distributions.

If you’re still facing issues with PPAs, let me know in the comments section. Additional suggestions, questions or a quick word of thanks are always welcome.

Similar Posts

  • I have installed Nitrux 2.2.1 build.300622 x86_64 and i can’t install it. Output is Reading package lists… Done
    Building dependency tree… Done
    Reading state information… Done
    Package software-properties-common is not available, but is referred to by another package.
    This may mean that the package is missing, has been obsoleted, or
    is only available from another source

    E: Package ‘software-properties-common’ has no installation candidate.
    Idk what to do.

  • So I am using a live Ubuntu USB to do some software recovery. I tried the install software-properties-common option and it says it is already installed but is set to manually installed. Any recommendations for this issue?

    • The message means that the package in question is installed explicitly, not as a dependency on another package. Usually, packages like software-properties-common are installed as a dependency of other package. When you remove the main package, these dependency packages are also removed. Since you chose to manually install it, now it won’t get removed automatically.

  • After I run this script “sudo apt-get install software-properties-common”.

    here is the result:

    Reading package lists… Done
    Building dependency tree
    Reading state information… Done
    software-properties-common is already the newest version (2.0.7).
    0 upgraded, 0 newly installed, 0 to remove and 399 not upgraded.

    Then run “sudo apt-get update”

    Here’s the result:

    Hit:1 https://download.docker.com/linux/ubuntu focal InRelease
    Hit:2 https://dl.google.com/linux/chrome/deb stable InRelease
    Hit:3 https://linux.teamviewer.com/deb stable InRelease
    Ign:4 http://packages.linuxmint.com ulyssa InRelease
    Hit:5 http://archive.ubuntu.com/ubuntu focal InRelease
    Hit:6 http://archive.canonical.com/ubuntu focal InRelease
    Hit:7 http://security.ubuntu.com/ubuntu focal-security InRelease
    Hit:8 http://packages.linuxmint.com ulyssa Release
    Hit:9 http://archive.ubuntu.com/ubuntu focal-updates InRelease
    Hit:11 http://archive.ubuntu.com/ubuntu focal-backports InRelease
    Reading package lists… Done

    Then I am trying to run “sudo add-apt-repository “deb [arch=amd64] https://download.docker.com/linux/ubuntu $(. /etc/os-release; echo “$UBUNTU_CODENAME”) stable”

    But still I am having this issue:

    sudo add-apt-repository: command not found

    Can you please help me about this?. I am new in linux I am really sorry.

  • how to fix apt-add repository error in Zorin OS-16

    [email protected]:~$ sudo add-apt-repository ppa:libreoffice/ppa
    ^CTraceback (most recent call last):
    File “/usr/bin/add-apt-repository”, line 137, in
    shortcut = shortcut_handler(line)
    File “/usr/lib/python3/dist-packages/softwareproperties/SoftwareProperties.py”, line 884, in shortcut_handler
    ret = factory(shortcut)
    File “/usr/lib/python3/dist-packages/softwareproperties/ppa.py”, line 470, in shortcut_handler
    return PPAShortcutHandler(shortcut)
    File “/usr/lib/python3/dist-packages/softwareproperties/ppa.py”, line 426, in __init__
    info = get_ppa_info(self.shortcut)
    File “/usr/lib/python3/dist-packages/softwareproperties/ppa.py”, line 380, in get_ppa_info
    ret = get_ppa_info_from_lp(user, ppa)
    File “/usr/lib/python3/dist-packages/softwareproperties/ppa.py”, line 110, in get_ppa_info_from_lp
    return get_info_from_lp(lp_url)
    File “/usr/lib/python3/dist-packages/softwareproperties/ppa.py”, line 104, in get_info_from_lp
    return get_info_from_https(lp_url, True)
    File “/usr/lib/python3/dist-packages/softwareproperties/ppa.py”, line 96, in get_info_from_https
    data = func(lp_url=url, accept_json=accept_json, retry_delays=retry_delays)
    File “/usr/lib/python3/dist-packages/softwareproperties/ppa.py”, line 138, in _get_https_content_py3
    lp_page = urllib.request.urlopen(request,
    File “/usr/lib/python3.8/urllib/request.py”, line 222, in urlopen
    return opener.open(url, data, timeout)
    File “/usr/lib/python3.8/urllib/request.py”, line 525, in open
    response = self._open(req, data)
    File “/usr/lib/python3.8/urllib/request.py”, line 542, in _open
    result = self._call_chain(self.handle_open, protocol, protocol +
    File “/usr/lib/python3.8/urllib/request.py”, line 502, in _call_chain
    result = func(*args)
    File “/usr/lib/python3.8/urllib/request.py”, line 1397, in https_open
    return self.do_open(http.client.HTTPSConnection, req,
    File “/usr/lib/python3.8/urllib/request.py”, line 1354, in do_open
    h.request(req.get_method(), req.selector, req.data, headers,
    File “/usr/lib/python3.8/http/client.py”, line 1252, in request
    self._send_request(method, url, body, headers, encode_chunked)
    File “/usr/lib/python3.8/http/client.py”, line 1298, in _send_request
    self.endheaders(body, encode_chunked=encode_chunked)
    File “/usr/lib/python3.8/http/client.py”, line 1247, in endheaders
    self._send_output(message_body, encode_chunked=encode_chunked)
    File “/usr/lib/python3.8/http/client.py”, line 1007, in _send_output
    self.send(msg)
    File “/usr/lib/python3.8/http/client.py”, line 947, in send
    self.connect()
    File “/usr/lib/python3.8/http/client.py”, line 1421, in connect
    self.sock = self._context.wrap_socket(self.sock,
    File “/usr/lib/python3.8/ssl.py”, line 500, in wrap_socket
    return self.sslsocket_class._create(
    File “/usr/lib/python3.8/ssl.py”, line 1040, in _create
    self.do_handshake()
    File “/usr/lib/python3.8/ssl.py”, line 1309, in do_handshake
    self._sslobj.do_handshake()
    KeyboardInterrupt