Ubuntu – Using apt-file to find missing packages

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:

apt-file update

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.

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!


Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google+ photo

You are commenting using your Google+ account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )


Connecting to %s