How do I find out what Debian package a file came from?

link|improve this question
feedback

2 Answers

up vote 4 down vote accepted

There are several utilites in Debian which perform this task; check this page for a description. I'll mention two of them, apt-file and dlocate.

apt-file searches its internal cache, thus allowing you to not install all the packages you want to search. Search is performed by launching apt-file search file.name.

dlocate is a fast alternative to dpkg -L (the command that lists package contents), and as so, it searches only installed packages. Search is performed by dlocate -S file.name.

Also you can search packages online using packages.debian.org server (the Search the contents of packages section).

link|improve this answer
feedback
user@host:~$ dpkg-query -S /bin/bash 
bash: /bin/bash

Where bash is the package name.

link|improve this answer
feedback

Your Answer

 
or
required, but never shown

Not the answer you're looking for? Browse other questions tagged or ask your own question.