In a previous post I was unable to run the add-apt-repository command because python-software-properties was not installed on Ubuntu Server. I found the solution (install python-software-properties) by searching the internet but I could have installed apt-file and found the answer myself.
So let’s install apt-file and see how to quickly find the package that contains add-apt-repository.
Open a terminal and issue these commands:
sudo apt-get update sudo apt-get install apt-file
I was prompted to update apt-file but you can do it manually using the command line:
Now that apt-file is installed and up-to-date let’s issue a search for add-apt-repository:
apt-file search add-apt-repository
The result of the search is as follows:
$ 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
As you can see the result tells us that the file that we are looking for is in the python-software-properties package. Once that is installed we can run the add-apt- repository command.
Apt-file is a great tool – and I am sure that I will be using it again in the near future!