As a concrete example I want to be able to take a particular tool that isn't installed (say nslookup) and be able to tell which package I need to install when the following fails:
apt-get install nslookup
E: Unable to locate package nslookup
Obviously I can google to find the answer for a specific package (dnsutils) but I want to know how to find it myself.
There are two ways I know of to do this:
and...
Do you have
command-not-found
installed?Just type the command in bash or zsh and it will tell you which package has it, and if you need to enable non-main repos or fix your PATH. Or call
command-not-found $command_name
.Or you could go to http://packages.ubuntu.com/file:bin/nslookup , but that defaults to karmic packages.
Do you need to do this from the command line? I usually just do a search on http://packages.ubuntu.com/ (or packages.debian.org) when I am looking for packages.
Ubuntu's online repository browser has "Search the contents of packages" feature. AFAIK, it's not implemented in apt-get/aptitude, but in the most cases you will be satisfied with "apt-get search" when searching for a package containing a similarly named program.