Frequently I know the name of the command line program that I need but I don't know the name of the package that provides the program. How do I find the name of the package that contains the program that I need? On RPM based systems they have the whatprovides option rpm -q --whatprovides /usr/X11R6/bin/xclock which will find the correct package. Is there anything similar for Debian based systems?
- 323
5 Answers
If the package is installed, you want dpkg -S /path/to/file. If the package isn't installed, then use the apt-file utility (apt-file update; apt-file search /path/to/file).
- 98,245
Ubuntu has a command-not-found utility which will tell you which package to install to get a specific command. If configured correctly (perhaps in the default install?) it will show up when you enter a command that isn't installed. However, you can also run it manually:
$ /usr/lib/command-not-found --ignore-installed test
The program 'test' is currently not installed. You can install it by typing:
sudo apt-get install coreutils
- 2,886
Ubuntu, as does Debian, comes with the apt-file application. This allows you, quite similar to apt-get, to just search for files in packages.
Thus, you'd have
$ apt-file update
$ apt-file search xclock
And there you go. If you're lucky, you can also use the interface at the bottom of the Debian packages site. This will work if the Ubuntu maintainers haven't changed that much compared to the original Debian version.
- 1,937
You can use Nala (frontend over apt). nala search "application name". Nala will return package names.
- 1