apt-get or aptitude equivalent to yum whatprovides

This depends on whether the package containing the file is already installed. If so, use dpkg -S filename.

If your intention is to find out which package to install to get a certain file, one option is to use the online packages.ubuntu.com: scroll down to "Search the contents of packages". Make sure that the right distribution is selected. If you're looking for a files irrespective of the path, check the appropriate option.

There is also apt-file. Because this method required updating the files database, however, I prefer the other, instant option.


You want the 'apt-file' command.

apt-file search /usr/share/gdm/themes/TreeFlower/background.png

Before using it, you may need to create or update its database by running:

apt-file update

wajig whichpkg /usr/share/gdm/themes/TreeFlower/background.png

You'll have to install wajig, which is a frontend to a bunch of utilities related to apt. If you use wajig, you can use all of those tools without having to memorize their names.

Tags:

Apt

Aptitude