If I try something like:

sudo add-apt-repository ppa:graphics-drivers/ppa

it raises an error: Command not found.

So I installed the repository with:

apt-get install software-properties-common

and it installed, however it still gives me

 apt-add-repository: Command not found

also it does not help to install python, tried that as well.

  • What does echo $PATH show? apt-add-repository should be in the /usr/bin folder. – Terrance Jun 7 '18 at 20:12
  • /usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:/usr/local/games:/snap/bin Do not know what to make of this through. – Vu3L5TmD Jun 7 '18 at 20:17
  • OK, so the path has it there. Make sure the file is in that folder then. ls -al /usr/bin/apt-add-repository And that one should be a link that points to add-apt-repository that should be in the same folder. – Terrance Jun 7 '18 at 20:21
  • It does point to add-apt-repository – Vu3L5TmD Jun 7 '18 at 20:25
  • Does ls -al /usr/bin/add-apt-repository then show an existing file? – Terrance Jun 7 '18 at 20:27

The application add-apt-repository is not in the /usr/bin folder where it needs to be thus causing apt-add-repository to fail since it is a link file.

ls -al /usr/bin/apt-add-repository 
lrwxrwxrwx 1 root root 18 May  8  2017 /usr/bin/apt-add-repository -> add-apt-repository

Run the following command to reinstall the software properties to reinstall the add-apt-repository application:

sudo apt install --reinstall software-properties-common

Now the file /usr/bin/add-apt-repository should exist and the commands should work now.

  • I think the real reason for OP's problem was a simple typo: apt-add-repository: Command not found. add-apt-.... or apt-add-.... – mook765 Jun 7 '18 at 22:24
  • @mook765 Both exist on my system. apt-add-repository is linked to add-apt-repository and they do this for mistyping or backwards compatibility like egrep is aliased to grep -E. There are no needs for them, but they sure help people. – Terrance Jun 7 '18 at 22:26
  • Wow, they both exist in my system too, didn't know that, one point for you... – mook765 Jun 7 '18 at 22:33

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.