The last time I encountered the add-apt-repository: command not found error I was using Ubuntu Server 12.4 Lucid. The solution then was to install python-software-properties as follows:
sudo apt-get install python-software-properties
This did not resolve the issue on my minimal virtual machine installation on Trusty so I installed apt-file – which is an apt package searching utility:
sudo apt-get install apt-file
Update apt-file:
apt-file update
Finally use apt-file to search for the add-apt-repository package:
apt-file search add-apt-repository
As you can see add-apt-repository is in software-properties-common:
software-properties-common: /usr/bin/add-apt-repository software-properties-common: /usr/share/man/man1/add-apt-repository.1.gz
After installing software-properties-common I was able to use add-apt-repository without any further issue:
sudo apt-get install software-properties-common
Thank you very much!
Happy to help Jim 🙂
Thanks a lot!
This really helped! Thanks a lot 🙂
Thanks Hojune – glad it helped you out! 🙂
Thanks!) Really helped!
Thanks, that worked for Ubuntu 14.04.
Many Thanks!
A most helpful post. Much appreciated!
thank you very much… was really very helpful…
It hasn’t worked for me… Ive tried all the forums and nothing is working.
this is what I get.
sudo apt-get install apt-file
Reading package lists… Done
Building dependency tree
Reading state information… Done
E: Unable to locate package apt-file
Hi David, have you amended your /etc/apt/sources.list file in anyway? Did you update your sources.list before trying to install apt-file?
sudo apt-get update
im in the same boat as david h — i can see apt-get-repository using this search and have done update but command not found is still the result. (maybe something changed in 14.04.5 LTS which is what i’m running?)
NEVER MIND!! i was typing the wrong command!! thanks!
Thank you. Sid.