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?
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
).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:
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
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.
You can also use apt-cache search [file] to check the local caches for the app.