How to fix add-apt-repository: command not found
Problem
When trying to add a PPA repository on Ubuntu or Debian, you might encounter the following error:
terminal-output.txt
$ sudo add-apt-repository ppa:some/ppa
sudo: add-apt-repository: command not found
Solution
The add-apt-repository
command is part of the software-properties-common
package. To install it, run the following command:
install-software-properties.sh
sudo apt-get update
sudo apt-get install software-properties-common
After that, you should be able to use the add-apt-repository
command without any issues.
In case you see the error message
terminal-output.txt
E: Unable to locate package software-properties-common
you might be using Debian Trixie. For Debian Trixie, I don’t know a direct method of using add-apt-repository
. Since PPAs are designed for Ubuntu, you might want to look for an alternative repository or consider upgrading to a more recent version of Debian or using Ubuntu if you need explicit PPA support.
Check out similar posts by category:
Linux
If this post helped you, please consider buying me a coffee or donating via PayPal to support research & publishing of new posts on TechOverflow