List Installed Packages with dpkg-query. The command will display a list of all installed packages including the packages versions, architecture, and a short description. A Debian repository is a set of Debian binary or source packages organized in a special directory tree with various infrastructure files. Alternatively, you can use apt-cache command to list all repositories. Using dpkg to find the package that provides a file only for installed DEB packages - from any source dpkg can also be used to find out to which package a file belongs to.
It can be faster to use than apt-file, because you don't need to install anything, and there's no database to update. However, dpkg can only search for files belonging to installed packages, so if you're searching for a file in a package that's not installed on your system, use apt-file. On the other hand, dpkg can be used to find files belonging to packages that were installed without using a repository, a feature that's not available for apt-file.
To use dpkg to find the installed DEB package that provides a file, run it with the -S or --search flag, followed by the filename or pattern you want to see to which package it belongs, like this: dpkg -S filename For example, to find out to which package the cairo. You can enter the full path of the file to get only the package that contains that specific file. For both, you'll also find options to find the packages that contain files named exactly like your input keyword, packages ending with the keyword, or packages that contains files whose names contain the keyword.
To install apt-file , use:. So usually it's a good idea to use an absolute path. You can see in the second example that 12 thousand files that are known to dpkg match the bare string 'ls'. It is superior over apt-file because it can find parts of filenames as well. It's also linked up to the main packages list which will list descriptions, bugs, etc. All in all a good website. Not as useful from the command line, but still quite useful. You can change 'suite' it from unstable to stable or testing if you like, for other versions of the distribution.
Wajig is a handy command line or console tool which wraps all the apt-get, dpkg goodness that you never wanted to learn. You'll have to scroll down a bit to find the "Search the contents of packages" searchbox where you can enter the path of a file. The command-not-found package gives you hints about potential commands and the name of the debian package. It works by typing the command in the bash shell and looking at its output. Sign up to join this community.
The best answers are voted up and rise to the top. Stack Overflow for Teams — Collaborate and share knowledge with a private group. Create a free Team What is Teams? Learn more. Ask Question. In this tutorial we will learn how to find out which package a file belongs to or owns in the Linux system.
You can use the dpkg and dpkg-query commands to find a package that provides a file. This command looks for a file name from the installed packages. You can use apt-file to search for files in DEB packages on your system, as well as packages that are not installed on your Debian systems but are available through the repositories. The apt-file package is not installed by default.
To install the apt file on Ubuntu and other Debian-based Linux distributions, enter:.
0コメント