I often find myself wanting to install something, but I'm unsure of what package it's in. This is a very common occurrence for me:
$ make html
sphinx-build -b djangohtml -d _build/doctrees . _build/html
make: sphinx-build: Command not found
make: *** [html] Error 127
$ sudo apt-get install sphinx
E: Unable to locate package sphinx
$ sudo apt-get install sphinx-build
E: Unable to locate package sphinx-build
googles
$ sudo apt-get install python-sphinx
Is there a better way?
Install apt-file and run
apt-file update
Then use
apt-file search sphinx-build
to search for packages contanining a file named sphinx-buildUbuntu is pretty smart. Just try to run it.
I don't know if apt-get can do it, but I prefer to use aptitude anyway.
Using its search command, you get a list of packages that contains the string you are searching for, however that still does not fully answer your question, as it does not reveal which package contains the binary you are looking for.
Example:
I like to use http://packages.ubuntu.com/ -- there's "Search the contents of packages" inside. Debian also has similar interface at http://packages.debian.org.
This has the advantage that you can use it without CLI access to Ubuntu itself, f.e. explaining things over a phone.
you can use the apt group of commands or aptitude which i recommend above apt. Here is the list to search
APT
To search for something similar to the command you want:
apt-cache search X
for exampleapt-cache search cheese
will give you everything related to cheese.To show what dependencies and stuff it has you would do
apt-cache show cheese
.Of course to install would be
apt-get install cheese
.APTITUDE
To search:
aptitude search cheese
which will show a more nicer list than aptTo show:
aptitude show cheese
which again will show a more nicer and friendlier listTo install:
aptitude install cheese
to install it. Again nicer.Also aptitude gives more relevant information to what you are looking for, for example:
apt-cache search phi
VSaptitude search phi
apt-cache search sphi
VSaptitude search sphi
If you want a GUI version i recommend Synaptic Package Manager or a simpler Software Center. In Synaptic you can look for something similar to what you are looking for and it will show it to you.
auto-apt
auto-apt
is a package that comes in handy a lot, especially with Makefiles andconfigure
scripts that reference things you might not have and don't know where to find, which is often tricky with header files. You invokedmake
in this case, and it tried to invokesphinx-build
, but failed when it couldn't find it.auto-apt run [...]
will run the command specified, then guide you through installing packages containing missing files that it knowsapt-get
can find and install.So, just invoke
auto-apt run make html
and see what happens :)For more information, see the the documentation for auto-apt