Ubuntu – apt-add-repository: Command not found


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.

Best Answer

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.