How to Fix Error sudo: add-apt-repository: command not found

To fix the error sudo: add-apt-repository: command not found is quite simple.

I got this error while I was trying to add a PPA at school, on a Ubuntu 12.04 LTS Server.

To fix this error, you have to install theĀ software-properties-common:

$ sudo apt-get install software-properties-common

This is all. Now your command for adding PPAs works like a charm.

If you want to find out how I have fixed this error by myself, without external / Google help, read further.

I have search with apt-file for the add-apt-repository and found out in which package is the command located. Apt file searches for files, inside packages and tells you in what package the file you had searched is located.

It is not installed by default, so you need to do this:

$ sudo apt-get install apt-file && apt-file update

This is how you use apt-file for fishing files inside packages:

$ apt-file search add-apt-repository
python-software-properties: /usr/bin/add-apt-repository
python-software-properties
: /usr/share/man/man1/add-apt-repository.1.gz

So, indeed, it is in theĀ python-software-properties package.

Share and Enjoy

  • Twitter
  • Facebook
  • Google Plus
  • Email
  • RSS
Tagged with: , , , , ,
Posted in The Linux and Unix Articles!
13 comments on “How to Fix Error sudo: add-apt-repository: command not found
  1. Michal says:

    Ubuntu Server 12.10 the package is under software-properties-common, and so the command must be modified to

    $sudo apt-get install software-properties-common

    if you are attempting to install this properties package.

  2. brad brace says:

    can I upgrade Kdenlive .7.2.1 on Ubuntu 8.10? if so, how? (without facing a new pack of trouble) — add-apt-repository command is not found

    thanks /:b

    • Geekster says:

      i do not know if you can, ubuntu 8.10 is obsolite, so there aren’t any updates from him. also, many ppas don’t have support for such old versions of ubuntu

  3. sudo apt-get install python-software-properties
    does not fix the problem on every Ubuntu. On mine it doesn’t do anything.

  4. tex says:

    sudo apt-get install software-properties-common

  5. Antonio says:

    Thank you for the blog post.
    In my case (ubuntu runing on a chromebook), it wasn’t the python-software-properties that was missing, but rather the software-properties-common package. I found it with the apt-file search.

  6. Christian Rojas says:

    With this command works fine!

    sudo apt-get update && sudo apt-get install python-software-properties

  7. Micael Valeri says:

    Didn’t work with sudo apt-get install software-proprieties-common

    but it worked with sudo apt-get install python-software-properties.

  8. Asanka says:

    Thanks for the tip about “apt-file search” !!

Leave a Reply

Your email address will not be published. Required fields are marked *

*

Subscribe

  

Subscribe to get the latest Linux news and how to guides directly on your e-mail!